From 9933b5910d4ffa1024478c28bd4b5952eaf9637d Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 21 Aug 2023 23:19:57 +0200 Subject: Boundary check --- src/lib/ndpi_main.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 8c553ef7f..cc3782d55 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4001,17 +4001,19 @@ int ndpi_handle_rule(struct ndpi_detection_module_struct *ndpi_str, is_ip = 1, value = &attr[3]; else if(strncmp(attr, "host:", 5) == 0) { /* host:"",host:"",.....@ */ - u_int i, max_len; - value = &attr[5]; if(value[0] == '"') value++; /* remove leading " */ - max_len = strlen(value) - 1; - if(value[max_len] == '"') - value[max_len] = '\0'; /* remove trailing " */ - - for(i=0; i