From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7A41C1382C5 for ; Wed, 16 Jun 2021 19:21:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CBBFBE0821; Wed, 16 Jun 2021 19:21:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B2857E0821 for ; Wed, 16 Jun 2021 19:21:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6475A335D50 for ; Wed, 16 Jun 2021 19:21:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DD81E7A0 for ; Wed, 16 Jun 2021 19:21:50 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1623871183.860ace7e297f4f79b1cd52c7bbee48a5a1ed78ce.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qmerge.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 860ace7e297f4f79b1cd52c7bbee48a5a1ed78ce X-VCS-Branch: master Date: Wed, 16 Jun 2021 19:21:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4e873cb4-9802-4f47-a278-303e37cbaade X-Archives-Hash: ad09a2b8f28da23121dc37e891a28d03 commit: 860ace7e297f4f79b1cd52c7bbee48a5a1ed78ce Author: Joakim Tjernlund infinera com> AuthorDate: Wed Jun 16 14:43:11 2021 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Wed Jun 16 19:19:43 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=860ace7e qmerge: Protect against NULL ptr hash will be NULL if file does not exist. Signed-off-by: Joakim Tjernlund infinera.com> Signed-off-by: Fabian Groffen gentoo.org> qmerge.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qmerge.c b/qmerge.c index 2e8730e..7b42956 100644 --- a/qmerge.c +++ b/qmerge.c @@ -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;