Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Check for return value of normalize_package
Browse files Browse the repository at this point in the history
Upon failure to download an AUR package, normalize_package returns NULL. In
crawl_resolve, the return value from the initial normalize_package is checked,
but not the ones when we normalize dependencies. They should also be checked
in the case of failure so we can abort the entire operation asap.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
  • Loading branch information
yanhan committed Jun 9, 2011
1 parent afd1711 commit 00b165a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions query.c
Expand Up @@ -318,6 +318,11 @@ static int crawl_resolve(CURL *curl, struct pw_hashdb *hashdb, struct pkgpair *c
depmod_list = alpm_pkg_get_depends(pkgpair->pkg);
for (i = depmod_list; i; i = i->next) {
depname = normalize_package(curl, hashdb, alpm_dep_get_name(i->data), force);
/* Possibility of normalize_package fail due to AUR download failing */
if (!depname) {
alpm_list_free(deps);
return -1;
}
deps = alpm_list_add(deps, (void *) depname);
}

Expand Down

0 comments on commit 00b165a

Please sign in to comment.