aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/http.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2021-01-07 10:58:02 +0100
committerGitHub <noreply@github.com>2021-01-07 10:58:02 +0100
commit1e2b57bed479f12c5c539d62663e6fa13059eb86 (patch)
treea6334839808eed1508293441faba2d60906a43c7 /src/lib/protocols/http.c
parent2080cc73655a55a25b7d643b8c194d450425e753 (diff)
HTTP: fix compilation and a memory error when NDPI_ENABLE_DEBUG_MESSAGES is defined (#1109)
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r--src/lib/protocols/http.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index 4e1d60d4a..0493a636e 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -112,9 +112,7 @@ static void ndpi_http_check_human_redeable_content(struct ndpi_detection_module_
const u_int8_t *content, u_int16_t content_len) {
if(content_len >= 4) {
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
- int i;
-
- printf(" [len: %u] [%02X %02X %02X %02X][%c%c%c%c]", len,
+ printf(" [len: %u] [%02X %02X %02X %02X][%c%c%c%c]", content_len,
content[0], content[1], content[2], content[3],
content[0], content[1], content[2], content[3]
);
@@ -146,7 +144,7 @@ static void ndpi_validate_http_content(struct ndpi_detection_module_struct *ndpi
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
printf("==>>> [len: %u] ", packet->payload_packet_len);
- printf("->> %s\n", (const char *)packet->content_line.ptr);
+ printf("->> %.*s\n", packet->content_line.len, (const char *)packet->content_line.ptr);
#endif
if(double_ret) {