diff options
author | 2021-06-16 16:43:11 +0200 | |
---|---|---|
committer | 2021-06-16 21:19:43 +0200 | |
commit | 860ace7e297f4f79b1cd52c7bbee48a5a1ed78ce (patch) | |
tree | db166433b2b7f05ddabc2e6408892e1c23d919b2 /qmerge.c | |
parent | qmerge: drop outdated comment (diff) | |
download | portage-utils-860ace7e297f4f79b1cd52c7bbee48a5a1ed78ce.tar.gz portage-utils-860ace7e297f4f79b1cd52c7bbee48a5a1ed78ce.tar.bz2 portage-utils-860ace7e297f4f79b1cd52c7bbee48a5a1ed78ce.zip |
qmerge: Protect against NULL ptr
hash will be NULL if file does not exist.
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qmerge.c')
-rw-r--r-- | qmerge.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1513,7 +1513,9 @@ pkg_unmerge(tree_pkg_ctx *pkg_ctx, set *keep, /* If the file wasn't modified, unmerge it */ char *hash = hash_file_at(portroot_fd, e->name + 1, HASH_MD5); - protected = strcmp(e->digest, (const char *)hash); + protected = 0; + if (hash) + protected = strcmp(e->digest, (const char *)hash); } break; |