Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Kapranov committed Jul 5, 2023
1 parent 1d3c3ef commit 4c7aa0e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lib/ndpi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8629,9 +8629,7 @@ static u_int16_t ndpi_automa_match_string_subprotocol(struct ndpi_detection_modu
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
{
char m[256];
u_int len = ndpi_min(sizeof(m), string_to_match_len);

if (len >= sizeof(m)) len--;
u_int len = ndpi_min(sizeof(m) - 1, string_to_match_len);

strncpy(m, string_to_match, len);
m[len] = '\0';
Expand All @@ -8657,9 +8655,7 @@ static u_int16_t ndpi_automa_match_string_subprotocol(struct ndpi_detection_modu
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
{
char m[256];
u_int len = ndpi_min(sizeof(m), string_to_match_len);

if (len >= sizeof(m)) len--;
u_int len = ndpi_min(sizeof(m) - 1, string_to_match_len);

strncpy(m, string_to_match, len);
m[len] = '\0';
Expand Down

0 comments on commit 4c7aa0e

Please sign in to comment.