lib/libalpm/dload.c: Add ASSERT() to alpm_fetch_pkgurl()

Return with ALPM_ERR_WRONG_ARGS instead of causing a potential segfault
if alpm_fetch_pkgurl() is invoked with a NULL URL.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Lukas Fleischer 2011-08-18 09:42:21 +02:00 committed by Dan McGee
parent 9f139550f8
commit 0745288c14
1 changed files with 1 additions and 0 deletions

View File

@ -450,6 +450,7 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url)
int ret;
CHECK_HANDLE(handle, return NULL);
ASSERT(url, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, NULL));
/* find a valid cache dir to download to */
cachedir = _alpm_filecache_setup(handle);