From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C30BD1382AC for ; Mon, 20 Jun 2016 17:46:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6E749E09D2; Mon, 20 Jun 2016 17:46:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 12A51E09D2 for ; Mon, 20 Jun 2016 17:46:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9F61933D3CD for ; Mon, 20 Jun 2016 17:46:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 371A71AE8 for ; Mon, 20 Jun 2016 17:46:31 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1466444705.e73183f42ef1b3915fca02fe3da044986c4cf98b.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: paxinc.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: e73183f42ef1b3915fca02fe3da044986c4cf98b X-VCS-Branch: master Date: Mon, 20 Jun 2016 17:46:31 +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-Archives-Salt: 1513a707-6c27-484a-8574-4fc15d480040 X-Archives-Hash: 25fa98cc2514080174e312005a7a02d1 commit: e73183f42ef1b3915fca02fe3da044986c4cf98b Author: Mike Frysinger gentoo org> AuthorDate: Mon Jun 20 17:45:05 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Jun 20 17:45:05 2016 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=e73183f4 ar: make sure file name is always NUL terminated paxinc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paxinc.c b/paxinc.c index bd13ec4..068aa60 100644 --- a/paxinc.c +++ b/paxinc.c @@ -109,9 +109,10 @@ close_and_ret: if (read(ar->fd, ret.buf.formatted.name, len) != len) goto close_and_ret; } else { - s = alloca(sizeof(char) * len); + s = alloca(sizeof(char) * len + 1); if (read(ar->fd, s, len) != len) goto close_and_ret; + s[len] = '\0'; } } else if (s[0] == '/' && s[1] >= '0' && s[1] <= '9') { /* GNU extended filename */