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 1DBFF138350 for ; Sun, 19 Jan 2020 19:09:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 39313E095D; Sun, 19 Jan 2020 19:09:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 01059E0918 for ; Sun, 19 Jan 2020 19:09:14 +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 1E43934E236 for ; Sun, 19 Jan 2020 19:09:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7E07BE3 for ; Sun, 19 Jan 2020 19:09:12 +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: <1579457647.c4e0ef9df105c2a1459d283cd3d977fcd31d363d.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/tree.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: c4e0ef9df105c2a1459d283cd3d977fcd31d363d X-VCS-Branch: master Date: Sun, 19 Jan 2020 19:09:12 +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: cf6c1891-8451-4b2a-a915-5f91ea405a4e X-Archives-Hash: 22fbebe06d7635308b37e96b915944bc commit: c4e0ef9df105c2a1459d283cd3d977fcd31d363d Author: Fabian Groffen gentoo org> AuthorDate: Sun Jan 19 18:14:07 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Jan 19 18:14:07 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=c4e0ef9d libq/tree: fix Coverity 206551 String not null terminated Signed-off-by: Fabian Groffen gentoo.org> libq/tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libq/tree.c b/libq/tree.c index 2efdb7c..9645237 100644 --- a/libq/tree.c +++ b/libq/tree.c @@ -618,10 +618,11 @@ tree_read_file_pms(tree_pkg_ctx *pkg_ctx) goto err; len = sizeof(*ret) + s.st_size + 1; - ret = xzalloc(len); + ret = xmalloc(len); ptr = (char*)ret + sizeof(*ret); if ((off_t)fread(ptr, 1, s.st_size, f) != s.st_size) goto err; + ptr[s.st_size] = '\0'; ret->Q_DEPEND = ptr; #define next_line(curr, next) \