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

MFC after:	1 week
This commit is contained in:
ae 2019-07-12 09:59:21 +00:00
parent 15268fa047
commit 571b48c044

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;
}