From nobody Fri Oct 09 00:26:45 2026 X-Original-To: dev-commits-src-all@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 4j172z4k3Bz6Z2dh for ; Fri, 09 Oct 2026 00:26:51 +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 4j172z2nLMz4TQs for ; Fri, 09 Oct 2026 00:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505611; 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=YzZnKuXVWmPPQ1yib3EBOSJIbC3gALvEJuLdAAfyiPOBvG4Cr4UjrDYCbAjzy5ArUHHERP Cl8AI7iCXXTAPNhDgnZXkfMGPa4vb/d1qQIaoUIT2W12wBBZ0n/S2JJPHIy27l4G66woCU gGlNUmWoGYyECl95ZhgMU1+DyPZUAMmPMzgWiQp6zjes++3fX5TzUz6U5Sx7vt51YcMd0c qW2iwnk9Ip2eX6aWKBRAawgAiyfkedwSgDAd9+NkoJAkcofJmb/jICtLTtSkzn7Vm2z0St CERVH6zsMftZOi+A5KIFo9Tp+n9SkX+1xSSRQ9eOqfEyFdVOSzD9VuLZOiiArw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791505611; b=T2Npai7kLLpvF1zO7KGRNTpeYYO2YW17kZ8iUg/quxRUzm+fONj8oC+yLsUNqGn8uRhuCa yXYNCotXZldbRMM9OHN45vk8A0RhOBuRplkvBf4yZmxEI9YFBNkMYmLbH4+1xuaV3HeTTb ujNPUyWXSouhyeyC/DO6Iuh8ljPpWzZZAH0PZaFtgE+RqaMGsx4KPubL2H7CH8ZYh7ws1m daXg6lU//+yOXsP2A9U+N0ImHpYyFI0QtH+aDyyasoC7djQXsaoU9gI12O1MsWkcwn3k7Y 2Xn9z2h+fnTuWIj7bhRDKUZ2sP69+iGM22E/afI6Wv8Q1tBtfK0+82vuCt72SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505611; 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=m46c3/E6+uVa7402lNkT84n1Lj0IU7zgKKHs2DBj+JQ29lhLCN5lhH+CfUrOdYg2P4wE42 KAQWn/h67UUWMYGqhMdgItJmBVraIUh0kfUPS24IWshm9V8hb+KjGaDjyYLW3LveElLMUB 0lT7aLevbU+eW1+PM23mcXmMPAiI3QXVkMhZXA+Rm5JX5r8wC9EkESUC9P0nkcdtJmzqDl khkYqx9Gv8+gK7RDcytuofOMWcj2SYwvcZi4cFsBPvrOttlUMTxAsDlN1y1dJ1PIb0VHTt 78HUvIFyaR7EjPjco70GafXEZjM/BG/JeELMalwhUt6pkc4zbSBaQmzNdKYCSg== 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 4j172z1Ywsz13Q1 for ; Fri, 09 Oct 2026 00:26:51 +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: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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));