Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 2025 15:08:09 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b3902af408a9 - main - pfctl: use str*l*cpy() to copy strings
Message-ID:  <202507071508.567F89N4017069@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=b3902af408a98ff5520d50e6af69652d9b2984d5

commit b3902af408a98ff5520d50e6af69652d9b2984d5
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-07-07 08:49:20 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-07-07 15:06:52 +0000

    pfctl: use str*l*cpy() to copy strings
    
    Ensure it's always '\0'-terminated.
    
    Reported by:    ivy@
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sbin/pfctl/pfctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 738c89069383..defba3b56c44 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1632,7 +1632,7 @@ pfctl_show_states(int dev, const char *iface, int opts)
 	struct pfctl_state_filter filter = {};
 
 	if (iface != NULL)
-		strncpy(filter.ifname, iface, IFNAMSIZ);
+		strlcpy(filter.ifname, iface, IFNAMSIZ);
 
 	arg.opts = opts;
 	arg.dotitle = opts & PF_OPT_SHOWALL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202507071508.567F89N4017069>