diff options
author | Luca Deri <deri@ntop.org> | 2020-02-19 23:44:22 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-02-19 23:44:22 +0100 |
commit | dd80ec869ad8991b811e2e13e7cb595e2d56ea64 (patch) | |
tree | 75cc1589ded130c919ec4038574ba7a45cdae711 | |
parent | 1714d7aa52c98a4a44b4d65a0ac11541f92d0e67 (diff) |
Fixes #837
-rw-r--r-- | src/lib/third_party/src/node.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/third_party/src/node.c b/src/lib/third_party/src/node.c index 96e25e8af..10a434308 100644 --- a/src/lib/third_party/src/node.c +++ b/src/lib/third_party/src/node.c @@ -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++) @@ -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; } |