MFC: 1.98

Check the length of the ipv4 and ipv6 address lists. It must be less
than F_LEN_MASK.

Approved by:	re (hrs)
This commit is contained in:
jhay 2006-09-20 19:20:19 +00:00
parent 7fb24b6083
commit 841f0777f7

View File

@ -2855,6 +2855,8 @@ fill_ip(ipfw_insn_ip *cmd, char *av)
len += 2; /* two words... */
d += 2;
} /* end while */
if (len + 1 > F_LEN_MASK)
errx(EX_DATAERR, "address list too long");
cmd->o.len |= len+1;
}
@ -3006,6 +3008,8 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av)
* Total length of the command, remember that 1 is the size of
* the base command.
*/
if (len + 1 > F_LEN_MASK)
errx(EX_DATAERR, "address list too long");
cmd->o.len |= len+1;
free(av);
return (1);