From 79968f3245ae7bf277e01d8c5a28349b75d9ac74 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Fri, 4 Feb 2022 15:57:17 +0100 Subject: Sync utests (#1433) * Sync utest results * Fix read-heap-buffer-overflow error reported by CI See: https://github.com/ntop/nDPI/runs/5055876515?check_suite_focus=true --- src/lib/ndpi_main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index d14c8086b..35a4091fc 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6096,6 +6096,8 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str, while((packet->authorization_line.len > 0) && (packet->authorization_line.ptr[0] == ' ')) packet->authorization_line.len--, packet->authorization_line.ptr++; + if(packet->authorization_line.len == 0) + packet->authorization_line.ptr = NULL; packet->http_num_headers++; } else @@ -6207,6 +6209,8 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str, while((packet->content_line.len > 0) && (packet->content_line.ptr[0] == ' ')) packet->content_line.len--, packet->content_line.ptr++; + if(packet->content_line.len == 0) + packet->content_line.ptr = NULL;; packet->http_num_headers++; } else -- cgit v1.2.3