Skip to content

Commit ebb8d77

Browse files
authored
Merge pull request #223 from Zadamsa/fix-ipv6-ext-headers-parsing
Fix IPv6 header parsing
2 parents 72cf1a7 + 024f1ed commit ebb8d77

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)