From nobody Sun Feb 06 14:26:05 2022 X-Original-To: dev-commits-src-main@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 035FC19ADF06; Sun, 6 Feb 2022 14:26:06 +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 4JsBQj6hryz3FY5; Sun, 6 Feb 2022 14:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644157565; 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=VAdvelcCaPR1rHIf9H3sU3FUMZQTpo23Ab7qj7NoKnc=; b=iZr+SNwFDzGgu6RMci/GfWcu0uSmC0rhMppUD4tSXYaKCzKQl9esedFjTK5oedyrvVDCNy JTSUZE7ib/VU0bPbimhRx4TZUJ1x+9DSgvlu8F2Xdz4LYC9sfTDHoiqnIW4Rl3rqLZQ19h lH3pOfRVx5TdIXVBSkGoPBGQAVRJOP5B68jTTnGSDvibzLOJm/EvtVP7B0FCZiNrj39ygi IPobkhuZfY5VWcr0uzIdZ/4IhQIKmjkKzolNhqlIIwkxWnxlm5Ah9anw7Ex09wFLQJSbAM qGjfDTv4n7MJZuFqqk+K3qchP9Rlm2xsi2qKr02t9HcjYdyqL2t32bVPFhA9Jw== 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 C5D8F13C60; Sun, 6 Feb 2022 14:26:05 +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 216EQ5ax002249; Sun, 6 Feb 2022 14:26:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 216EQ50t002248; Sun, 6 Feb 2022 14:26:05 GMT (envelope-from git) Date: Sun, 6 Feb 2022 14:26:05 GMT Message-Id: <202202061426.216EQ50t002248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: d310bf3867b4 - main - Fix too small hostname buffer in bootparamd List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d310bf3867b4168e57365196c3a31797c0538097 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644157565; 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=VAdvelcCaPR1rHIf9H3sU3FUMZQTpo23Ab7qj7NoKnc=; b=Vop0uMv8l8aOXDnYKcmgCCAvZzIEaIZ78S98rW8K6h4gu1O8Hyuan58yFv6cly3aiJJDma NZdxKkfdnpQxQm0MfIUCjtAOJlcHCLB3+ZhgQXQJYi31vO0jlwAuSCxBw5T7BVtcdNhflm K+No91am6YS1f64qn3EBjpprswqqS8/ew4bl5dAST8JrlrH8xhaSdRJg2Qz5KPWWs7qKl3 NQ8u+dlnVCyl6XkRugL3QLdkEmo0PwqAM11jjy0xwXydfjwPkoMkc2UXWv8lodPQo3omQ3 LMW8LoZp0ybwhfOFElMxP9QCI7LPOmgxnK8Ao0g3kKJywKcOTwULupRWXB2hFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644157565; a=rsa-sha256; cv=none; b=m6Nbu54pgNKenbv8pBMiasPSaAHSGpTYH4nn2fKgFG6kkFoannoYii1B1fCc5qiKm5es5N yPhwG/HTXsY5LTXGNGDWDDveKf26ZICEO9Vho7HUsj3JW1iUX5+at76nPgFFvdrA83Ma/p sdBBDmRvwgxuV4KqY3E/B1zr4s1+UXFsvzrdmvvfSczGtcuFc+2jNeI9z4OX/l+yXUfOdT cREz+zofDvpV7l6zK895FbUrD+YsTkLa6Ct9YPwtbyOIXRHEeVoNJghUs6aoTFYja5hbwt gZsZaT7euaJpoBHaL7c8kbc4C+QDm4DkdNVhtLvHy1LyM6mcdBsZ16BkaDOY6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d310bf3867b4168e57365196c3a31797c0538097 commit d310bf3867b4168e57365196c3a31797c0538097 Author: Dimitry Andric AuthorDate: 2022-02-06 14:25:22 +0000 Commit: Dimitry Andric CommitDate: 2022-02-06 14:25:49 +0000 Fix too small hostname buffer in bootparamd This fixes the following warning from clang 14: usr.sbin/bootparamd/bootparamd/bootparamd.c:204:32: error: 'fscanf' may overflow; destination buffer in argument 3 has size 255, but the corresponding specifier may require size 256 [-Werror,-Wfortify-source] The MAX_MACHINE_NAME macro indicates the maximum number of bytes in a machine name, but it does not include the NUL terminator required for scanf. MFC after: 3 days --- usr.sbin/bootparamd/bootparamd/bootparamd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bootparamd/bootparamd/bootparamd.c b/usr.sbin/bootparamd/bootparamd/bootparamd.c index be885de62f55..5bbd5b4becef 100644 --- a/usr.sbin/bootparamd/bootparamd/bootparamd.c +++ b/usr.sbin/bootparamd/bootparamd/bootparamd.c @@ -34,7 +34,7 @@ extern const char *bootpfile; static struct hostent *he; static char buffer[MAXLEN]; -static char hostname[MAX_MACHINE_NAME]; +static char hostname[MAX_MACHINE_NAME + 1]; static char askname[MAX_MACHINE_NAME]; static char path[MAX_PATH_LEN]; static char domain_name[MAX_MACHINE_NAME];