From 0745288c1441c73a0c6ce4279823d8363bcdc62f Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 18 Aug 2011 09:42:21 +0200 Subject: 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 Signed-off-by: Dan McGee --- lib/libalpm/dload.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 68a68e9c..3376ec40 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -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); -- cgit v1.2.3-70-g09d2