From 4be2a0ee846125d28587d9e1fb75b7c274fa3948 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 7 Oct 2014 07:57:38 +0200 Subject: [PATCH] lib/pkgdb.c: CID 62719 (NULL pointer dereference) --- lib/pkgdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pkgdb.c b/lib/pkgdb.c index de5e6754..7a7ee186 100644 --- a/lib/pkgdb.c +++ b/lib/pkgdb.c @@ -319,7 +319,9 @@ xbps_pkgdb_get_pkg_revdeps(struct xbps_handle *xhp, const char *pkg) generate_full_revdeps_tree(xhp); xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver); - pkgname = xbps_pkg_name(pkgver); + if ((pkgname = xbps_pkg_name(pkgver)) == NULL) + return NULL; + res = xbps_dictionary_get(xhp->pkgdb_revdeps, pkgname); free(pkgname);