aboutsummaryrefslogtreecommitdiffstats
path: root/main/apk-tools/info-segfault.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/apk-tools/info-segfault.patch')
-rw-r--r--main/apk-tools/info-segfault.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/main/apk-tools/info-segfault.patch b/main/apk-tools/info-segfault.patch
new file mode 100644
index 0000000000..9479fade30
--- /dev/null
+++ b/main/apk-tools/info-segfault.patch
@@ -0,0 +1,22 @@
+commit 87420aaf295f58847332ba3aa89691a0259baace
+Author: Timo Teras <timo.teras@iki.fi>
+Date: Wed May 5 08:56:06 2010 +0300
+
+ info: fix querying of removed, but referenced packages
+
+ Check that package name has packages associated with it before
+ dereferencing the pointer. Fixes #345.
+
+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;
+ }