Merge remote-tracking branch 'OE-2.1/master' into vuplus-3.0
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-devtools / opkg / opkg / 0006-pkg_hash_fetch_conflicts-fix-possible-segfaults.patch
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
5
6 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
7 ---
8  libopkg/pkg_depends.c |    8 ++++++--
9  1 file changed, 6 insertions(+), 2 deletions(-)
10
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)
23 +                continue;
24 +            }
25 +            if (!possible_satisfier->pkg) {
26                  opkg_msg(ERROR, "Internal error: possible_satisfier->pkg=NULL\n");
27 +                continue;
28 +            }
29             test_vec = possible_satisfier->pkg->pkgs;
30             if (test_vec) {
31                  /* pkg_vec found, it is an actual package conflict
32 -- 
33 1.7.9.5
34