diff options
-rw-r--r-- | include/net/cipso_ipv4.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index a7a683e30b64..a8c2ef6d3b93 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h | |||
@@ -290,6 +290,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, | |||
290 | unsigned char err_offset = 0; | 290 | unsigned char err_offset = 0; |
291 | u8 opt_len = opt[1]; | 291 | u8 opt_len = opt[1]; |
292 | u8 opt_iter; | 292 | u8 opt_iter; |
293 | u8 tag_len; | ||
293 | 294 | ||
294 | if (opt_len < 8) { | 295 | if (opt_len < 8) { |
295 | err_offset = 1; | 296 | err_offset = 1; |
@@ -302,11 +303,12 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, | |||
302 | } | 303 | } |
303 | 304 | ||
304 | for (opt_iter = 6; opt_iter < opt_len;) { | 305 | for (opt_iter = 6; opt_iter < opt_len;) { |
305 | if (opt[opt_iter + 1] > (opt_len - opt_iter)) { | 306 | tag_len = opt[opt_iter + 1]; |
307 | if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { | ||
306 | err_offset = opt_iter + 1; | 308 | err_offset = opt_iter + 1; |
307 | goto out; | 309 | goto out; |
308 | } | 310 | } |
309 | opt_iter += opt[opt_iter + 1]; | 311 | opt_iter += tag_len; |
310 | } | 312 | } |
311 | 313 | ||
312 | out: | 314 | out: |