From 86b11419f509e70488ffceecc55a478707efcc76 Mon Sep 17 00:00:00 2001 From: Petr Vaganov Date: Wed, 28 May 2025 19:11:03 +0500 Subject: [PATCH] ipfw: fix checking the end of a line Under the debugger, it shows that the problem lies in the lack of checking the end of the line and the successful access to memory for the line in the last iteration of the loop, if the line does not end with the character '}' --- ipfw/ipfw2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ipfw/ipfw2.c b/ipfw/ipfw2.c index b8ef6ee..e66a979 100644 --- a/ipfw/ipfw2.c +++ b/ipfw/ipfw2.c @@ -2935,6 +2935,8 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int cblen, struct tidx *tstate) i = a; else if (*s == '}') break; + else if (*s == '\0') + break; av = s+1; } return;