diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2023-07-14 01:33:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-14 01:33:00 +0200 |
commit | 0dd1ee5656e94e42e919d88d2d783b7e53e246a5 (patch) | |
tree | 0991074f82ec60161c3e569b0e17ddb61edeea74 | |
parent | bfbbd187576cc6b80a97488b647305236936debe (diff) |
HTTP: fix extraction of filename (#2046)
-rw-r--r-- | src/lib/protocols/http.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 072f7d3de..8885906d9 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -287,7 +287,8 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo if(packet->content_disposition_line.len > 0) { u_int8_t attachment_len = sizeof("attachment; filename"); - if(packet->content_disposition_line.len > attachment_len) { + if(packet->content_disposition_line.len > attachment_len && + strncmp((char *)packet->content_disposition_line.ptr, "attachment; filename", 20) == 0) { u_int8_t filename_len = packet->content_disposition_line.len - attachment_len; int i; |