ipfw: guard against NULL deref with clat/plat prefixes without length

Found with:	Claude Code Sonnet 5
MFC after:	2 weeks
This commit is contained in:
Maxim Konovalov committed 2026-09-15 18:03:32 +00:00
1 parent 6ac71529b2
commit 47b02ace19
1 file changed
+3
+3
View File
@@ -208,6 +208,9 @@ nat64clat_create(const char *name, uint8_t set, int ac, char *av[])
if ((p = strchr(*av, '/')) != NULL)
*p++ = '\0';
else
errx(EX_USAGE,
"Prefix length required: %s", *av);
if (inet_pton(AF_INET6, *av, &prefix) != 1)
errx(EX_USAGE,
"Bad prefix: %s", *av);