Fixes #837
This commit is contained in:
Vendored
+11
-1
@@ -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 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;
|
AC_PATTERN_t * str;
|
||||||
|
|
||||||
for (i=0; i < thiz->matched_patterns_num; i++)
|
for (i=0; i < thiz->matched_patterns_num; i++)
|
||||||
@@ -149,12 +152,19 @@ int node_has_matchstr (AC_NODE_t * thiz, AC_PATTERN_t * newstr)
|
|||||||
if (str->length != newstr->length)
|
if (str->length != newstr->length)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* Original code */
|
||||||
for (j=0; j<(int)str->length; j++)
|
for (j=0; j<(int)str->length; j++)
|
||||||
if(str->astring[j] != newstr->astring[j])
|
if(str->astring[j] != newstr->astring[j])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (j == str->length)
|
if (j == str->length)
|
||||||
return 1;
|
return 1;
|
||||||
|
#else
|
||||||
|
/* https://github.com/ntop/nDPI/issues/837 */
|
||||||
|
if (strncmp(str->astring, newstr->astring, str->length) == 0)
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user