summaryrefslogtreecommitdiffstats
path: root/main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch')
-rw-r--r--main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch b/main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch
new file mode 100644
index 00000000..4df956bf
--- /dev/null
+++ b/main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch
@@ -0,0 +1,27 @@
+From 87420aaf295f58847332ba3aa89691a0259baace Mon Sep 17 00:00:00 2001
+From: Timo Teras <timo.teras@iki.fi>
+Date: Wed, 5 May 2010 08:56:06 +0300
+Subject: [PATCH 1/5] 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 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/info.c b/src/info.c
+index 7ca486c..d944fca 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;
+ }
+--
+1.7.1
+