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 3CC0C1381F3 for ; Fri, 4 Oct 2013 19:07:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE08CE0A02; Fri, 4 Oct 2013 19:07:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3C42CE09EF for ; Fri, 4 Oct 2013 19:07:57 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5685733EE5B for ; Fri, 4 Oct 2013 19:07:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 068F0E5308 for ; Fri, 4 Oct 2013 19:07:55 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1380913306.681a37e7bd64a1cdc39613e7ded594dda8e98208.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/librc/librc-depend.c X-VCS-Directories: src/librc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 681a37e7bd64a1cdc39613e7ded594dda8e98208 X-VCS-Branch: master Date: Fri, 4 Oct 2013 19:07:55 +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: 906899b2-d438-4aab-91d9-41ca87e7500e X-Archives-Hash: dc4aeb1dc44207666bb13c09db300e49 commit: 681a37e7bd64a1cdc39613e7ded594dda8e98208 Author: Natanael Copa gmail com> AuthorDate: Thu Sep 26 07:59:29 2013 +0000 Commit: William Hubbs gentoo org> CommitDate: Fri Oct 4 19:01:46 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=681a37e7 librc: fix off-by-one bug We need allocate space for both the added leading '-' and the trailing '\0'. Signed-off-by: Natanael Copa alpinelinux.org> --- src/librc/librc-depend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c index ac93716..c9df451 100644 --- a/src/librc/librc-depend.c +++ b/src/librc/librc-depend.c @@ -856,7 +856,7 @@ rc_deptree_update(void) * work for them. This doesn't stop them from being run directly. */ if (sys) { len = strlen(sys); - nosys = xmalloc(len + 1); + nosys = xmalloc(len + 2); nosys[0] = '-'; for (i = 0; i < len; i++) nosys[i + 1] = (char)tolower((unsigned char)sys[i]);