aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2025-01-09 09:23:23 +0000
committerKristof Provost <kp@FreeBSD.org>2025-01-14 08:54:19 +0000
commita8136ab47c97d470b39246b53a64ebbe76f5413f (patch)
treec914a2fb52486ef356db185d2ed912ebdbd6b6a0
parent6a3266f72e437aecf3edcfb8aa919466b270d548 (diff)
pfctl: convert an snprintf to strlcpy
ok mikeb henning Obtained from: OpenBSD, dhill <dhill@openbsd.org>, a592d7cf61 Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r--sbin/pfctl/pfctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 4b2a69f456a2..ca374ca3295d 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1234,7 +1234,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
if (anchorname[0] == '/') {
if ((npath = calloc(1, MAXPATHLEN)) == NULL)
errx(1, "pfctl_rules: calloc");
- snprintf(npath, MAXPATHLEN, "%s", anchorname);
+ strlcpy(npath, anchorname, MAXPATHLEN);
} else {
if (path[0])
snprintf(&path[len], MAXPATHLEN - len, "/%s", anchorname);