From nobody Tue Nov 12 03:28:14 2024 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 4XnX1W1FbMz5d3Ws; Tue, 12 Nov 2024 03:28:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XnX1W0N2rz45rg; Tue, 12 Nov 2024 03:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731382095; 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=GLdtv8kZ/trjIcKC1+4/qLjz5jQisdVNWiJNxU8bzSY=; b=N8125vf+XVhAzIfL0L27C//kJY6HPgpfrtKp1RqzhyHXPMzWcEcZC7t++QqM9Q6SLgCQbg 28TvbOwsrj+k1/VpqDauEden6zsTB70+VMIfDWqSLLVVW520tFpkWlLU9KStrBWVtkFeaY ay+LZMVdo0F3DUPgGX06YgLi2rGnCjZtRHcFogaYnCT0T4o0yNfhqkuwfHrPxCgXY/nB4W hdz1ye0uhRMbIo40xp96jZbbYb2VDVAdKyS2JufVjDvLMIYZKgfBcbHH432YVPKYAstZxA IovfU1JUJhZWS2rdOpAuhM+heScsBqa2Z8w4Q6rjby3gWVat4Om63HoT/gdDZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731382095; 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=GLdtv8kZ/trjIcKC1+4/qLjz5jQisdVNWiJNxU8bzSY=; b=U34E8OfDYdZZN+VWeODicOTuntb++XQbtXaQ7gwWq5FjEua8TJ8cfeNigny43+V5gHwMEG 0TynUWsdttXugMl1W9XrohjBBKRumTwI/xGRTuabE9bA+EQM8PeQnVLrMhiNE9akXSKMQa sddNo/cHKpxV6FlpGtktmryC5LK1wiJ6Z8o7G/vWuFyUTq9Z44WFq/zD8Rr72zaaREcJuX 13TFB2LW1+zEWJJxcxYltP2SYIrQrpH2UbYmCoAAq7SC+0QwYM1eQyupW8udqURfcMVh1O nWhwCQsEdWyFv1Rex3ZZlc3/dvyWr7vtcdhGd00NOehjUQxfIfZZf33Uo21qRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731382095; a=rsa-sha256; cv=none; b=R2HjzZ2+6k4KBuQOOuAfUMNvdOJejTCHy0EU8Kzrfop+MjWFPkRU4olwUlkxlXDU/2A1LO quK7AjgBP4c2jtjyk1vFZ2a2Dls5YVoS6Io5M78xaKpFh7NRAhViWKCwytgBa4StfSbkzX AO5LxWGMuM3gQJgs7wta70WBflp+emILeBri2fKrjkdMyMsekqJAa6pYqBiNb3zju/6VKS /vDJX0/H/ZerdnOsJE0H7fn93Nnrq/o1xyAKiB/nBECZI9G/m311yLHas42nuKrNCeyyOn 1N+3kym4RktwUtaxnIVoht/4Td9r7rq4DH62M7EyW9AnfCsXAwDBaW81To3ysw== 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 4XnX1V6xP9zt9R; Tue, 12 Nov 2024 03:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AC3SE4x077902; Tue, 12 Nov 2024 03:28:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AC3SEb2077899; Tue, 12 Nov 2024 03:28:14 GMT (envelope-from git) Date: Tue, 12 Nov 2024 03:28:14 GMT Message-Id: <202411120328.4AC3SEb2077899@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 42935716286e - main - ipfilter: Avoid overrunning the message buffer 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42935716286e7887bfeb9dd8daea72d6a5d40908 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=42935716286e7887bfeb9dd8daea72d6a5d40908 commit 42935716286e7887bfeb9dd8daea72d6a5d40908 Author: Cy Schubert AuthorDate: 2024-11-07 01:22:57 +0000 Commit: Cy Schubert CommitDate: 2024-11-12 03:14:31 +0000 ipfilter: Avoid overrunning the message buffer Avoid overrunning the message buffer when printing an ippool btree error. We do this in two ways. First we increase the message buffer from 80 to 255 bytes and secondly we replace strcat(3) with strlcat(3). MFC after: 1 week --- sbin/ipf/libipf/load_poolnode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/ipf/libipf/load_poolnode.c b/sbin/ipf/libipf/load_poolnode.c index 5c9fd838bfa0..8d65f019da43 100644 --- a/sbin/ipf/libipf/load_poolnode.c +++ b/sbin/ipf/libipf/load_poolnode.c @@ -52,11 +52,11 @@ load_poolnode(int role, char *name, ip_pool_node_t *node, int ttl, if (err != 0) { if ((opts & OPT_DONOTHING) == 0) { - char msg[80]; + char msg[255]; snprintf(msg, sizeof(msg), "%s pool node(%s/", what, inet_ntoa(pn.ipn_addr.adf_addr.in4)); - strcat(msg, inet_ntoa(pn.ipn_mask.adf_addr.in4)); + strlcat(msg, inet_ntoa(pn.ipn_mask.adf_addr.in4), sizeof(msg)); return (ipf_perror_fd(pool_fd(), iocfunc, msg)); } }