diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2023-01-19 14:13:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 14:13:17 +0100 |
commit | f5c2f9280cbf06b716a5849cc4f9005a37c49f19 (patch) | |
tree | 1ff967f8c1a8cafe2018899969c46011e6e88712 | |
parent | f95bdaf625a540cbd040508bfbb8808223f97aed (diff) |
Fix undefined-behaviour in ahocorasick callback (#1864)
```
ndpi_main.c:2119:28: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
```
Found by oss-fuzz
See: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55226
-rw-r--r-- | src/lib/ndpi_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 21ec14de3..13a800183 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -2116,7 +2116,7 @@ int ac_domain_match_handler(AC_MATCH_t *m, AC_TEXT_t *txt, AC_REP_t *match) { * the length of the pattern is longer than that of the previous one. * Skip shorter (less precise) templates. */ - if(!(m->match_map & (1 << i))) + if(!(m->match_map & (1u << i))) continue; start = end - pattern->length; |