diff options
author | William Pitcock <nenolod@dereferenced.org> | 2017-04-25 00:00:19 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2017-04-25 00:00:19 +0000 |
commit | e7f8d71d2b2a0cab693aa26c687f8745c2560908 (patch) | |
tree | 6c7d187eb2c437f190a06368804ec24c75d55531 | |
parent | a841d6b259a10240d4beb55046b27caa3f7f6868 (diff) | |
download | apk-tools-e7f8d71d2b2a0cab693aa26c687f8745c2560908.tar.gz apk-tools-e7f8d71d2b2a0cab693aa26c687f8745c2560908.tar.bz2 apk-tools-e7f8d71d2b2a0cab693aa26c687f8745c2560908.tar.xz apk-tools-e7f8d71d2b2a0cab693aa26c687f8745c2560908.zip |
fetch: don't segfault when given an unknown package name
-rw-r--r-- | src/fetch.c | 3 |
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) |