1 From e2b289330280e9f9fb5dd2cc10c736ca06d273f4 Mon Sep 17 00:00:00 2001
2 From: Andreas Oberritter <obi@opendreambox.org>
3 Date: Thu, 17 May 2012 01:15:15 +0200
4 Subject: [PATCH 06/10] pkg_hash_fetch_conflicts: fix possible segfaults
6 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
8 libopkg/pkg_depends.c | 8 ++++++--
9 1 file changed, 6 insertions(+), 2 deletions(-)
11 diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
12 index 68a81f9..6ff75f1 100644
13 --- a/libopkg/pkg_depends.c
14 +++ b/libopkg/pkg_depends.c
15 @@ -322,10 +322,14 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
16 /* foreach possible satisfier */
17 for(j = 0; j < conflicts->possibility_count; j++){
18 possible_satisfier = possible_satisfiers[j];
19 - if (!possible_satisfier)
20 + if (!possible_satisfier) {
21 opkg_msg(ERROR, "Internal error: possible_satisfier=NULL\n");
22 - if (!possible_satisfier->pkg)
25 + if (!possible_satisfier->pkg) {
26 opkg_msg(ERROR, "Internal error: possible_satisfier->pkg=NULL\n");
29 test_vec = possible_satisfier->pkg->pkgs;
31 /* pkg_vec found, it is an actual package conflict