Avoid reading past the end of the array.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 2 Nov 2009 02:34:29 +0000 (02:34 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 2 Nov 2009 02:34:29 +0000 (02:34 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@236 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_cmd.c

index b2ba7a549a55c937839a5d10a5f22423644ad2ff..e7038c5691d206748c047e432ca2ff8eaa99be9a 100644 (file)
@@ -455,7 +455,7 @@ static int opkg_recurse_pkgs_in_order(opkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *
             dependents = abpkg->provided_by->pkgs;
             l = 0;
             if (dependents != NULL)
-                while (dependents [l] != NULL && l < abpkg->provided_by->len) {
+                while (l < abpkg->provided_by->len && dependents[l] != NULL) {
                     opkg_message(conf, OPKG_INFO,
                                  "  Descending on pkg: %s\n", 
                                  dependents [l]->name);