opkg: fix nullpointer dereference
authorpixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 2 Nov 2009 15:47:29 +0000 (15:47 +0000)
committerpixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 2 Nov 2009 15:47:29 +0000 (15:47 +0000)
Applied 011-fix_nullpointer_deref.patch from OpenWRT

git-svn-id: http://opkg.googlecode.com/svn/trunk@240 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_cmd.c

index 99ee64d510340d075f3f486385d5bdd87dd89d3e..d9ad77a4816048f821a4d4b5a40d19deb25e8a5c 100644 (file)
@@ -951,7 +951,7 @@ static int opkg_remove_cmd(opkg_conf_t *conf, int argc, char **argv)
                    pkg_to_remove = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, pkg->name );
                }
         
-               if (pkg == NULL) {
+               if (pkg_to_remove == NULL) {
                    opkg_message(conf, OPKG_ERROR, "Package %s is not installed.\n", pkg->name);
                    continue;
                }