diff options
| -rw-r--r-- | net/ipv4/ip_options.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 5e7aecea05cd..ad382499bace 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
| @@ -288,6 +288,10 @@ int ip_options_compile(struct net *net, | |||
| 288 | optptr++; | 288 | optptr++; |
| 289 | continue; | 289 | continue; |
| 290 | } | 290 | } |
| 291 | if (unlikely(l < 2)) { | ||
| 292 | pp_ptr = optptr; | ||
| 293 | goto error; | ||
| 294 | } | ||
| 291 | optlen = optptr[1]; | 295 | optlen = optptr[1]; |
| 292 | if (optlen < 2 || optlen > l) { | 296 | if (optlen < 2 || optlen > l) { |
| 293 | pp_ptr = optptr; | 297 | pp_ptr = optptr; |
