Skip to content

Commit 024f1ed

Browse files
committed
Fix IPv6 header parsing
1 parent 72cf1a7 commit 024f1ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

input/parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ uint16_t skip_ipv6_ext_hdrs(const u_char *data_ptr, uint16_t data_len, Packet *p
357357

358358
/* Skip/parse extension headers... */
359359
while (1) {
360-
if ((int)sizeof(struct ip6_ext) > data_len - hdrs_len) {
360+
if (hdrs_len > data_len || sizeof(struct ip6_ext) > data_len - hdrs_len) {
361361
throw "Parser detected malformed packet";
362362
}
363363
if (next_hdr == IPPROTO_HOPOPTS ||

0 commit comments

Comments
 (0)