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 774C61381F3 for ; Tue, 8 Oct 2013 17:10:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 851ECE0933; Tue, 8 Oct 2013 17:10:24 +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 B9AB5E08E1 for ; Tue, 8 Oct 2013 17:10:23 +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 C4CA233EF4B for ; Tue, 8 Oct 2013 17:10:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 762CCE5464 for ; Tue, 8 Oct 2013 17:10:21 +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: <1381251969.5b0f323da983f316dc05e4d3fa73cc75ea0fd0f1.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:openrc-0.12.x 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: 5b0f323da983f316dc05e4d3fa73cc75ea0fd0f1 X-VCS-Branch: openrc-0.12.x Date: Tue, 8 Oct 2013 17:10:21 +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: 61251e46-e2e8-40c6-bce6-c8def55c1f10 X-Archives-Hash: ea17401a761e3dd3523898a34bc53636 commit: 5b0f323da983f316dc05e4d3fa73cc75ea0fd0f1 Author: Natanael Copa gmail com> AuthorDate: Thu Sep 26 07:59:29 2013 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue Oct 8 17:06:09 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5b0f323d 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]);