From 15fc1ee4115e465fc2e5c839d1e290e7dde70533 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 27 Feb 2017 23:23:59 +0100 Subject: [PATCH] opkg_cmd: avoid null pointer dereference in opkg_what_depends_conflicts_cmd() Signed-off-by: Jo-Philipp Wich --- libopkg/opkg_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c index d0d2877..543eef4 100644 --- a/libopkg/opkg_cmd.c +++ b/libopkg/opkg_cmd.c @@ -1033,7 +1033,7 @@ opkg_what_depends_conflicts_cmd(enum depend_type what_field_type, int recursive, deps = pkg_get_ptr(pkg, (what_field_type == CONFLICTS) ? PKG_CONFLICTS : PKG_DEPENDS); - for (cdep = deps; cdep->type; cdep++) { + for (cdep = deps; cdep && cdep->type; cdep++) { if (what_field_type != cdep->type) continue; -- 2.30.2