aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Antoine <contact@catenacyber.fr>2019-10-30 17:18:21 +0100
committerPhilippe Antoine <contact@catenacyber.fr>2019-10-30 17:18:21 +0100
commit4830755face20a493c65e14600c0b7bdfdc9319f (patch)
treef28ee853dde4dd88ba5772def2dde70364a320d1
parentaf01e61c89a66630fdc76e5059c0a348226e6f40 (diff)
Fix buffer over read in ndpi_handle_ipv6_extension_headers
-rw-r--r--src/lib/ndpi_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index ac8364761..cf463793d 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -3518,6 +3518,9 @@ static int ndpi_handle_ipv6_extension_headers(struct ndpi_detection_module_struc
}
// the other extension headers have one byte for the next header type
// and one byte for the extension header length in 8 byte steps minus the first 8 bytes
+ if (*l4len < 2) {
+ return(1);
+ }
ehdr_len = (*l4ptr)[1];
ehdr_len *= 8;
ehdr_len += 8;