Skip to content

Commit

Permalink
Check parameters against NULL when querying ALPM packages' ouf-of-dat…
Browse files Browse the repository at this point in the history
…e flag
  • Loading branch information
f2404 committed May 20, 2016
1 parent 99884eb commit 448d0b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/alpm-query.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,10 @@ static bool alpm_pkg_get_outofdate (alpm_pkg_t *pkg)
const char *arch = alpm_pkg_get_arch (pkg);
const char *name = alpm_pkg_get_name (pkg);

if (!repo || !arch || !name) {
return false;
}

/* https://www.archlinux.org/packages/$repo/$arch/$name/json/ */
int ret = asprintf (&url, "%s%s/%s/%s/json/", ARCH_PACKAGES_URL, repo, arch, name);
if (ret > 0) {
Expand Down

0 comments on commit 448d0b2

Please sign in to comment.