info: fix querying of removed, but referenced packages

Check that package name has packages associated with it before
dereferencing the pointer. Fixes #345.
cute-signatures
Timo Teras 2010-05-05 08:56:06 +03:00
parent f024add886
commit 87420aaf29
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}