]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/ipv4/ip_options.c
Updated to mainline v3.16
[karo-tx-linux.git] / net / ipv4 / ip_options.c
index 5e7aecea05cd2afbd3e3e13f417e26687517b468..ad382499bace4ce3852c2953bb262f2796d9a416 100644 (file)
@@ -288,6 +288,10 @@ int ip_options_compile(struct net *net,
                        optptr++;
                        continue;
                }
+               if (unlikely(l < 2)) {
+                       pp_ptr = optptr;
+                       goto error;
+               }
                optlen = optptr[1];
                if (optlen < 2 || optlen > l) {
                        pp_ptr = optptr;