aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVitaly Lavrov <vel21ripn@gmail.com>2022-02-28 17:01:00 +0300
committerGitHub <noreply@github.com>2022-02-28 15:01:00 +0100
commitc390085f91d569d953ab5e199e95d580a5cf8f63 (patch)
tree40fa24d99858b4dc3bcef0b52be51df1114f4c2d /src
parent00d9a16b6a7e3c5ca90930e3991ac3476bd48780 (diff)
Bug fixing. (#1459)
The '--enable-debug-messages' option works again. Fixed warning in ahocorasick.c Fixed integer overflow in ndpiReader.c for 32bit systems.
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_main.h4
-rw-r--r--src/lib/third_party/src/ahocorasick.c2
2 files changed, 5 insertions, 1 deletions
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__