Skip to content

Commit

Permalink
HTTP: fix extraction of filename (#2046)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi authored Jul 13, 2023
1 parent bfbbd18 commit 0dd1ee5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/protocols/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0dd1ee5

Please sign in to comment.