The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f78c18a7ac9ebb5079ad4afebd248881e3672ed2
commit f78c18a7ac9ebb5079ad4afebd248881e3672ed2 Author: Kristof Provost <k...@freebsd.org> AuthorDate: 2025-06-30 16:29:01 +0000 Commit: Kristof Provost <k...@freebsd.org> CommitDate: 2025-07-04 08:31:11 +0000 pfctl: sync cmdline_symset() changes with src/usr.sbin OK sashan@ claudio@ Obtained from: OpenBSD, miko <m...@openbsd.org>, 22023c0153 Obtained from: OpenBSD, kn <k...@openbsd.org>, d0f238ef32 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index beff11bebf69..c59204d3d5a4 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -7150,11 +7150,10 @@ pfctl_cmdline_symset(char *s) if ((val = strrchr(s, '=')) == NULL) return (-1); - if ((sym = malloc(strlen(s) - strlen(val) + 1)) == NULL) + sym = strndup(s, val - s); + if (sym == NULL) err(1, "%s: malloc", __func__); - strlcpy(sym, s, strlen(s) - strlen(val) + 1); - ret = symset(sym, val + 1, 1); free(sym);