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 F0AA3138351 for ; Wed, 22 Jan 2020 20:11:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E6807E07A7; Wed, 22 Jan 2020 20:11:31 +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 BBB51E086D for ; Wed, 22 Jan 2020 20:11:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 6C99634E371 for ; Wed, 22 Jan 2020 20:11:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BDC4A97 for ; Wed, 22 Jan 2020 20:11:28 +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: <1579723557.9bcc67d7155a2fa2287d1f2600d3ca2419b51e09.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qmanifest.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 9bcc67d7155a2fa2287d1f2600d3ca2419b51e09 X-VCS-Branch: master Date: Wed, 22 Jan 2020 20:11:28 +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: f02d9067-ab89-4212-8d4c-4db0a89b7dcb X-Archives-Hash: 8a42b7be43aaee446bca521560ec9ff5 commit: 9bcc67d7155a2fa2287d1f2600d3ca2419b51e09 Author: Fabian Groffen gentoo org> AuthorDate: Wed Jan 22 20:05:57 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Wed Jan 22 20:05:57 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9bcc67d7 qmanifest: fix Coverity 206530 Explicit null dereferenced Signed-off-by: Fabian Groffen gentoo.org> qmanifest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qmanifest.c b/qmanifest.c index bead1c9..31c4696 100644 --- a/qmanifest.c +++ b/qmanifest.c @@ -1489,7 +1489,8 @@ verify_manifest( * - Manifest at top-level, needs to be igored as it only points to * the larger Manifest.files.gz */ - qsort(elems, elemslen, sizeof(elems[0]), compare_elems); + if (compare_elems > 1) + qsort(elems, elemslen, sizeof(elems[0]), compare_elems); snprintf(buf, sizeof(buf), "%s/%s", dir, manifest); ret = verify_dir(dir, elems, elemslen, 0, buf + 2, msgs); checked_manifests++;