summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-05-14 07:18:11 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-05-14 07:18:11 +0000
commit6db3bbd790954ce2db241fd68f4b10e34c442893 (patch)
treedc2eefdcc75ea1edb3d8197c6750f7ab56ecfcd6
parent83840727f067e4e9524fd8aa755b31e93dfaa78e (diff)
downloadapk-tools-6db3bbd790954ce2db241fd68f4b10e34c442893.tar.bz2
apk-tools-6db3bbd790954ce2db241fd68f4b10e34c442893.tar.xz
index: fix segfault bug when trying to deleting an unresolved dep
-rw-r--r--src/index.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c
index e906ab4..7bf11ae 100644
--- a/src/index.c
+++ b/src/index.c
@@ -86,7 +86,7 @@ static int index_main(void *ctx, int argc, char **argv)
if (ictx->delete) {
struct apk_name *name;
name = apk_db_query_name(&db, APK_BLOB_STR(argv[i]));
- if (name == NULL)
+ if (name == NULL || name->pkgs == NULL)
continue;
/* apk_db_index_write() will only print the pkgs
where repos == 0. We prevent to write the given