From nobody Fri Oct 09 00:30:10 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j176q2SZ1z6Z2yw for ; Fri, 09 Oct 2026 00:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j176q0Lj7z4VL5 for ; Fri, 09 Oct 2026 00:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F42SAti232eJFbo0TAqI7j3i6l3WSXtfEBqtEFY/eIw=; b=tmHpS3nj9N9C88d00x5OoqOspNZ6/GKRtM7M5yaNrLUgBSkScjEqCRwkaptvLmVBmMByil zNPi60NsMueXAqQh/QjJRF7KkU+wnHPcf+ivsCAwtwrN+jUPncCfYIOgoz6N7LNqFdBntR F6th9imvczaXAoWcZiRhRw8vcquXdvK6hRw+Y58W7lLCHQvec1FFFSNRBbkrP2Db//Kc96 T3l2z07hi4QFvbExdpyzuXnluP+4p/9vkVFCPZ0jRXQZSiZTPOybJuN5MxcklTvxMF5ZMM 3VmKdx38fIOt4ecX3A7exbWW13hXh5yqNX1fL5If6lM5gU2xHldv08JyAxjg0w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791505811; b=aOeD8bqdPEeyMYG/1tj39SgvwrnQUjLnECoapSbG8agigTfsSRjV63JO0fL1Io0AAv9oNf Hp1KwTyRTof6J5GsY2knyADq2t2wpk4baQcZF7czqj7eJ+7NXeBRG8yqdpxEHsaNpoZdNu taxtaHi34XNBm04sORvm8eDCohDG42JFJ2+mQxN1Eq3msebq2jGEZcYhCBBG8UgbUZgLcZ /iXUleAvaWM+WkM800/wzgubmLgQkQsuFamMqyfaamQBf2BH57l2Muz32P/qZLqyjpR0Ir qKFsZDDbnms3McMp1eFiY+a470p95yIYmv8P5+CFVbpNPk4WNFCgQ2LsuznqMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F42SAti232eJFbo0TAqI7j3i6l3WSXtfEBqtEFY/eIw=; b=ujf4H74vd9Ky5SqmO+HIQM4nqaTa8WLRSB4xtEzwoU95PzzDR3dSw4GpKyuK+/pQsVBojY X+KibTUzAuI31E0/89sKGUJptYQqNHf5xnrMio4CN9nkM1cvtD4y6+OWLZAcikXPWgZ9bx KySap3PGIKPVXdVrzG3Otq9pAG8pkTkBO1Sxpl3RqBLa4V0/UMW2eEOh+NBNGxY90PAAQ7 Yw0sUS8wbMijBSvW4oq7lZ7e23bmcCO8QBNRbBbsOJbfmXvXTlZSYE7HaPKQJ6ogAL/F7M XQCSYa8uDTUaiXOec7kpMTjS1HbLgZxhHlH0qgd/ppM89V+qr2G4Yz807qZIvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j176p5xdvz13Bx for ; Fri, 09 Oct 2026 00:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c700 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 09 Oct 2026 00:30:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 88a592407ef7 - stable/14 - libc/stdlib/getenv.c: always allocate new environment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88a592407ef7df6e1140231f9316e5b607444eb6 Auto-Submitted: auto-generated Date: Fri, 09 Oct 2026 00:30:10 +0000 Message-Id: <6ac83592.1c700.51823b90@gitrepo.freebsd.org> The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=88a592407ef7df6e1140231f9316e5b607444eb6 commit 88a592407ef7df6e1140231f9316e5b607444eb6 Author: Konstantin Belousov AuthorDate: 2026-09-24 18:30:57 +0000 Commit: Konstantin Belousov CommitDate: 2026-10-09 00:29:53 +0000 libc/stdlib/getenv.c: always allocate new environment PR: 298747 (cherry picked from commit dec68aeff8ce0ce154e93325a74bba6af71c87af) --- lib/libc/stdlib/getenv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c index f8f59526421a..7a7912d3f703 100644 --- a/lib/libc/stdlib/getenv.c +++ b/lib/libc/stdlib/getenv.c @@ -267,7 +267,7 @@ __rebuild_environ(int newEnvironSize) int tmpEnvironSize; /* Resize environ. */ - if (newEnvironSize > environSize) { + if (newEnvironSize > environSize || intEnviron == NULL) { tmpEnvironSize = newEnvironSize * 2; tmpEnviron = reallocarray(intEnviron, tmpEnvironSize + 1, sizeof(*intEnviron));