correct more out-of-bounds memory access, if cnt == 1 and optlen > 1.
similar to recent fix to sys/netinet/ipf.c (by darren).
This commit is contained in:
parent
fc81cf82e9
commit
fdcb8debf6
@ -1078,6 +1078,10 @@ ip_dooptions(m)
|
||||
if (opt == IPOPT_NOP)
|
||||
optlen = 1;
|
||||
else {
|
||||
if (cnt < IPOPT_OLEN + sizeof(*cp)) {
|
||||
code = &cp[IPOPT_OLEN] - (u_char *)ip;
|
||||
goto bad;
|
||||
}
|
||||
optlen = cp[IPOPT_OLEN];
|
||||
if (optlen <= 0 || optlen > cnt) {
|
||||
code = &cp[IPOPT_OLEN] - (u_char *)ip;
|
||||
|
Loading…
x
Reference in New Issue
Block a user