summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2017-04-25 00:00:19 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2017-04-25 00:00:19 +0000
commite7f8d71d2b2a0cab693aa26c687f8745c2560908 (patch)
tree6c7d187eb2c437f190a06368804ec24c75d55531 /src
parenta841d6b259a10240d4beb55046b27caa3f7f6868 (diff)
downloadapk-tools-e7f8d71d2b2a0cab693aa26c687f8745c2560908.tar.bz2
apk-tools-e7f8d71d2b2a0cab693aa26c687f8745c2560908.tar.xz
fetch: don't segfault when given an unknown package name
Diffstat (limited to 'src')
-rw-r--r--src/fetch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fetch.c b/src/fetch.c
index 48848af..81d4449 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -218,7 +218,8 @@ static void mark_error(struct fetch_ctx *ctx, const char *match, struct apk_name
static void mark_name_flags(struct apk_database *db, const char *match, struct apk_name *name, void *ctx)
{
- name->auto_select_virtual = 1;
+ if (!IS_ERR_OR_NULL(name))
+ name->auto_select_virtual = 1;
}
static void mark_name_recursive(struct apk_database *db, const char *match, struct apk_name *name, void *ctx)