Do not modify cmd pointer if it is already last opcode in the rule.

MFC after:	1 week
This commit is contained in:
Andrey V. Elsukov 2019-07-12 09:59:21 +00:00
parent 4ee2f4c180
commit 2dab0de635
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349941

View File

@ -387,7 +387,7 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_fw *rule,
while (l > 0) {
cmdlen = F_LEN(cmd);
l -= cmdlen;
if (cmd->opcode == O_EXTERNAL_ACTION)
if (cmd->opcode == O_EXTERNAL_ACTION || l <= 0)
break;
cmd += cmdlen;
}