From 87420aaf295f58847332ba3aa89691a0259baace Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Wed, 5 May 2010 08:56:06 +0300 Subject: info: fix querying of removed, but referenced packages Check that package name has packages associated with it before dereferencing the pointer. Fixes #345. --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 7ca486c164..d944fca065 100644 --- a/src/info.c +++ b/src/info.c @@ -283,7 +283,7 @@ static int info_package(struct info_ctx *ctx, struct apk_database *db, for (i = 0; i < argc; i++) { name = apk_db_query_name(db, APK_BLOB_STR(argv[i])); - if (name == NULL) { + if (name == NULL || name->pkgs == NULL) { apk_error("Not found: %s", argv[i]); return 1; } -- cgit v1.2.3