diff options
author | Timo Teras <timo.teras@iki.fi> | 2010-05-05 08:56:06 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2010-05-05 08:56:06 +0300 |
commit | 87420aaf295f58847332ba3aa89691a0259baace (patch) | |
tree | 85c2df98d583959d8fa6ee571e55c8fdb0fb8105 | |
parent | f024add8865a2d6aa4acfba32f86559d298c4ee8 (diff) | |
download | apk-tools-87420aaf295f58847332ba3aa89691a0259baace.tar.gz apk-tools-87420aaf295f58847332ba3aa89691a0259baace.tar.bz2 apk-tools-87420aaf295f58847332ba3aa89691a0259baace.tar.xz apk-tools-87420aaf295f58847332ba3aa89691a0259baace.zip |
info: fix querying of removed, but referenced packages
Check that package name has packages associated with it before
dereferencing the pointer. Fixes #345.
-rw-r--r-- | src/info.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |