mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 09:11:07 -04:00
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
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Reference in a new issue