aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/protocols/http.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index 926b7f032..072f7d3de 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -300,7 +300,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo
flow->http.filename[filename_len-1] = '\0';
}
}
- else{
+ else if(filename_len >= 2) {
//case: filename="file_name"
flow->http.filename = ndpi_malloc(filename_len-1);
@@ -310,8 +310,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo
flow->http.filename[filename_len-2] = '\0';
}
}
- }
- else{
+ } else {
//case: filename=file_name
flow->http.filename = ndpi_malloc(filename_len+1);