From nobody Mon Dec 05 00:30:34 2022 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 4NQPbG6DVYz4k28Q; Mon, 5 Dec 2022 00:30:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NQPbG5nLxz4NtY; Mon, 5 Dec 2022 00:30:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670200234; 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=B0+0hmLIWgCBfb0hopyYF/vYXm7HHjjg5p/zOXi3u7c=; b=eQYUWogSFpjDtFAUVxtQhc30CMM3sIv4KtyA95a0x2se7aBsVffvIsitSoGDImToKZPgoP jQ57ScCNhS8rxzZ4nShuDOXpc9lECg3uuBr/jPxsRvr9O8twKa1chj231ooLHci4VmM5BT VEWT1fegxUCpzs+sk3a9G4ZuJ78UIXf/YtOuRoeM8mEqxxiziESDKUsLhuvQJJuxTp5YM9 SuQQSn33VSbUaEXY4wsx2MPM0lCM0FFSJGA3DH7jf/KwFBhZQF8EVzKV9yO7V6zVRLvkkT s8sPGv/NNAx6t7dPeUik1RZzFB1bfcfRR/LjeGMn6MFHxBMqjrKOxzcChUmYJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670200234; 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=B0+0hmLIWgCBfb0hopyYF/vYXm7HHjjg5p/zOXi3u7c=; b=wirCszy6OUslDSt38q2w1rv7M6JgfMYSx+FMGbGJCEpI5Jkp6eU4nPRYyIfDP11hs/K7Qs 4mYjWkQVUpZtbmSI4Kl+WuJAr+1TINTDh7Ivoed8qQjyewgokZaOk07F5ggRb4IZDKCXhy XAf1Z5D7fz+VqT1PYkMlF1rGzzxZNw3LKe+SDqZe+yTxQUW7jlXbxPr9UHljb6JRKGfgrC dsyQT2UDnAxlIWtOEe5pv3ecgnImGBZeOJ+PQpstvhbp0K1iOL0/08CdR5sXDgQk+eE4kp 8GWrv0z2by/IazcRESFhnXmzfDK9eY6G5W/FgeqNjF/JdHMNd/K1NdfWYnLzGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670200234; a=rsa-sha256; cv=none; b=jUHyj5GO09M9akjpc85XgoM9U9/TPCCkY74dIypWYFDGnCN5RQS8qXNMRm/2PSonhriBWK r3wMZyjZPwCdct/kmkAJEqUfqrYV21OksbXVQHS4jX3aTEVlC6Oca3OArYVmD0lqDaE7UQ MH/otbT7iTXuJM8eDs0uL7nRiqP+IQHepmF8Z0EblvQt4SDqfWSlpqEoLj/PrA0nu2F8Vx +zfbGwcr59RW4sKGUCf+j3iQYlqRbUnkklg1B0MDKXsoTZNVNqDdbmeqwit2V+cjf143Jz ulTVvqA+tYlQ2xIXiIUP/LZLpyPo5V8wDX/akFQFllONYMUmf2czgh9pu519kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NQPbG4vHyzdPx; Mon, 5 Dec 2022 00:30:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2B50UYOr069608; Mon, 5 Dec 2022 00:30:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B50UYka069607; Mon, 5 Dec 2022 00:30:34 GMT (envelope-from git) Date: Mon, 5 Dec 2022 00:30:34 GMT Message-Id: <202212050030.2B50UYka069607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1055bedbed42 - main - pw: Don't return a pointer to an on-stack buffer from grp_set_passwd. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1055bedbed42dc176468b45b4f167a752ed8868f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1055bedbed42dc176468b45b4f167a752ed8868f commit 1055bedbed42dc176468b45b4f167a752ed8868f Author: John Baldwin AuthorDate: 2022-12-05 00:28:22 +0000 Commit: John Baldwin CommitDate: 2022-12-05 00:28:22 +0000 pw: Don't return a pointer to an on-stack buffer from grp_set_passwd. Make 'line' static to move it to .bss instead as that pattern is used elsewhere in pw(8) (e.g. the static buffer in pw_pwcrypt). Reported by: GCC -Wdangling-pointer Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37534 --- usr.sbin/pw/pw_group.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 1f5979a5dd03..838bafa3e8ba 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -55,7 +55,8 @@ grp_set_passwd(struct group *grp, bool update, int fd, bool precrypted) int b; int istty; struct termios t, n; - char *p, line[256]; + static char line[256]; + char *p; if (fd == -1) return;