Skip to content

Commit

Permalink
Fixes #837
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Feb 19, 2020
1 parent 1714d7a commit dd80ec8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/lib/third_party/src/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ AC_NODE_t * node_findbs_next (AC_NODE_t * thiz, AC_ALPHABET_t alpha)
******************************************************************************/
int node_has_matchstr (AC_NODE_t * thiz, AC_PATTERN_t * newstr)
{
int i, j;
int i;
#if 0
int j;
#endif
AC_PATTERN_t * str;

for (i=0; i < thiz->matched_patterns_num; i++)
Expand All @@ -149,12 +152,19 @@ int node_has_matchstr (AC_NODE_t * thiz, AC_PATTERN_t * newstr)
if (str->length != newstr->length)
continue;

#if 0
/* Original code */
for (j=0; j<(int)str->length; j++)
if(str->astring[j] != newstr->astring[j])
continue;

if (j == str->length)
return 1;
#else
/* https://github.com/ntop/nDPI/issues/837 */
if (strncmp(str->astring, newstr->astring, str->length) == 0)
return 1;
#endif
}
return 0;
}
Expand Down

0 comments on commit dd80ec8

Please sign in to comment.