Skip to content

Commit

Permalink
Fixes #845
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Feb 19, 2020
1 parent 080e23e commit 90e08b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/third_party/src/ahocorasick.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,17 @@ AC_ERROR_t ac_automata_add (AC_AUTOMATA_t * thiz, AC_PATTERN_t * patt)
}
}

if(n->final)
if(n->final) {
#if 0
/* Original code */
return ACERR_DUPLICATE_PATTERN;

#else
/* ntop */
memcpy(&n->matched_patterns->rep, &patt->rep, sizeof(AC_REP_t));
return ACERR_SUCCESS;
#endif
}

n->final = 1;
node_register_matchstr(n, patt, 0);
thiz->total_patterns++;
Expand Down

0 comments on commit 90e08b3

Please sign in to comment.