From c390085f91d569d953ab5e199e95d580a5cf8f63 Mon Sep 17 00:00:00 2001 From: Vitaly Lavrov Date: Mon, 28 Feb 2022 17:01:00 +0300 Subject: Bug fixing. (#1459) The '--enable-debug-messages' option works again. Fixed warning in ahocorasick.c Fixed integer overflow in ndpiReader.c for 32bit systems. --- src/include/ndpi_main.h | 4 ++++ src/lib/third_party/src/ahocorasick.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/include/ndpi_main.h b/src/include/ndpi_main.h index 9029265bb..66567d871 100644 --- a/src/include/ndpi_main.h +++ b/src/include/ndpi_main.h @@ -25,6 +25,10 @@ #define __NDPI_MAIN_H__ #include "ndpi_includes.h" +#ifdef NDPI_LIB_COMPILATION +/* for macros NDPI_LOG_* in ndpi_define.h */ +#include "ndpi_config.h" +#endif #include "ndpi_define.h" #include "ndpi_protocol_ids.h" #include "ndpi_typedefs.h" diff --git a/src/lib/third_party/src/ahocorasick.c b/src/lib/third_party/src/ahocorasick.c index 39b08443b..aefd7ae03 100644 --- a/src/lib/third_party/src/ahocorasick.c +++ b/src/lib/third_party/src/ahocorasick.c @@ -798,7 +798,7 @@ static void node_release(AC_NODE_t * thiz, int free_pattern) /* Nonzero if X is not aligned on a "long" boundary. */ #undef UNALIGNED /* Windows defined it but differently from what Aho expects */ -#define UNALIGNED(X) ((long)X & (__SIZEOF_LONG__ - 1)) +#define UNALIGNED(X) ((intptr_t)X & (__SIZEOF_LONG__ - 1)) #define LBLOCKSIZE __SIZEOF_LONG__ -- cgit v1.2.3