summaryrefslogtreecommitdiffstats
path: root/main/apk-tools/0001-info-fix-querying-of-removed-but-referenced-packages.patch
blob: 4df956bf363fdd39ff2a160197fdfb8404bb880e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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