Do not segfault with badly formed URL
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
4a115b4dca
commit
f343db5b8e
1 changed files with 1 additions and 1 deletions
|
@ -1114,7 +1114,7 @@ int SYMEXPORT alpm_fetch_pkgurl(alpm_handle_t *handle, const alpm_list_t *urls,
|
||||||
STRDUP(payload->fileurl, url, FREE(payload); GOTO_ERR(handle, ALPM_ERR_MEMORY, err));
|
STRDUP(payload->fileurl, url, FREE(payload); GOTO_ERR(handle, ALPM_ERR_MEMORY, err));
|
||||||
|
|
||||||
c = strrchr(url, '/');
|
c = strrchr(url, '/');
|
||||||
if(strstr(c, ".pkg")) {
|
if(c != NULL && strstr(c, ".pkg")) {
|
||||||
/* we probably have a usable package filename to download to */
|
/* we probably have a usable package filename to download to */
|
||||||
payload->allow_resume = 1;
|
payload->allow_resume = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue