aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/ndpi_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index ab5f7b6e8..839e8a334 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -8629,7 +8629,7 @@ static u_int16_t ndpi_automa_match_string_subprotocol(struct ndpi_detection_modu
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
{
char m[256];
- int len = ndpi_min(sizeof(m), string_to_match_len);
+ u_int len = ndpi_min(sizeof(m) - 1, string_to_match_len);
strncpy(m, string_to_match, len);
m[len] = '\0';
@@ -8655,7 +8655,7 @@ static u_int16_t ndpi_automa_match_string_subprotocol(struct ndpi_detection_modu
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
{
char m[256];
- int len = ndpi_min(sizeof(m), string_to_match_len);
+ u_int len = ndpi_min(sizeof(m) - 1, string_to_match_len);
strncpy(m, string_to_match, len);
m[len] = '\0';