devnodes-minimal: new recipe to create /dev/console and /dev/null
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0004-pkg_hash_fetch_conflicts-fix-possible-segfaults.patch
1 From a066ab779583e9c037416b859481904484daf46b 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 04/17] 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 8291c68..cd9d2c8 100644
13 --- a/libopkg/pkg_depends.c
14 +++ b/libopkg/pkg_depends.c
15 @@ -403,10 +403,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.8.1.2
34