From nobody Fri Oct 09 00:26:45 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 4j172t2THKz6Z2db for ; Fri, 09 Oct 2026 00:26:46 +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 4j172t1j0qz4TL1 for ; Fri, 09 Oct 2026 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505606; 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=ERFAgauGovMyoOQvZ42HdkAnsGFSqJ4XtenMUYDByuo=; b=ftojZu5zUmsyDGhepGvcPrONEVL3Ois7wbhcCDM0fXe9l58zJggsWOetCuTI1L5P+hQGr/ AOp3ckSvQapv0QtctlkyI6K3mJ0nc3dW/VDTHpRIatZd4yV+C5oeI3goACMAHQQOMjjCuk KYAyCl5pA/FeDsrzYOaY/gnneo3exWBC7tAJNn3UtH23fLnSBoHXQainJfvxR0Oi/zBwOo DUIpbAiE1kS/K/CuDvyZCE88Qt3IE3eTDviInlySynH6VdybgLOh2lS3ooymz38Z3270Ta Dm9nDj5Z80r055B6geZYkekztSlxD8jIgsm3sTX1M1Pl8pgA+CoicqHib1gZjA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791505606; b=MB1MlbHJmH8S8uRGU6f4Zj4Fc6hkkbWaFYcu5u5IAbVBE2RtXvq3XSEmupMF8MvhrAf7Du iMa/0iMH+E0gupU49du69YG7T6EENJYnVHyf/UX8cE42UtmEPXbRqd2eyy5SnaVpTLSDJS zX4JOz4DuZBfdjcjAsi6wPOaeGr9Pr3kCm0tDNpNC33sDjoHJV3RtlkOFPlr4yjwL+1x0O 1S4CkYRfwvZ1EnzC2VS9x18w28g0vuWlmFpu598VWxsGa0SJuABX+SceJyiJG7AI/AtMEk z8gfEQ09F7l5aYHtNOJUGM4Hk+eSNjFw1n1j2Zo5oCUGZGvX2crlWoEZ3LjfFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505606; 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=ERFAgauGovMyoOQvZ42HdkAnsGFSqJ4XtenMUYDByuo=; b=SEzi/4Eh0NbMK5hgoYs6njKBso8eIpCZiC+AijxCTR8/qE+vxRoUQ1Bh2kRMctp4UG1Tpl Ek2ukpSjDpMMXHlJ6eele7C1S+VKBxM/g75kbbnFqctlKXJVX9pC9tpk307i9WlpO7ps1W 648NhqZEpt/ddASQFx6PyL+BCVjQJ0R0lqViZMKsm/2ogj1hgTNE+2Ztf/NUMyJO4N049N GL+H+lQkLum6JHigjXoIn4P9bZ0578d/vO4itilPZQU4n85uVk46iSFEMLyEhTi2UMFjIb KSOFGXOhpAXgfECQ+e+mrrOhT/cp7TePyZn6NKCGt5HMiaxbGuDSmUZQqTI9XQ== 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 4j172t0Mcjz136F for ; Fri, 09 Oct 2026 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c100 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 09 Oct 2026 00:26:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a6d8b449d9a3 - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: a6d8b449d9a3d0d2b9c8e96a225c02c486799476 Auto-Submitted: auto-generated Date: Fri, 09 Oct 2026 00:26:45 +0000 Message-Id: <6ac834c5.1c100.52a34928@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a6d8b449d9a3d0d2b9c8e96a225c02c486799476 commit a6d8b449d9a3d0d2b9c8e96a225c02c486799476 Author: Konstantin Belousov AuthorDate: 2026-09-24 18:30:57 +0000 Commit: Konstantin Belousov CommitDate: 2026-10-09 00:25:34 +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 c1d0b7a559d5..1fff081002e2 100644 --- a/lib/libc/stdlib/getenv.c +++ b/lib/libc/stdlib/getenv.c @@ -268,7 +268,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));