aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/ndpi_main.c11
-rw-r--r--src/lib/protocols/mdns_proto.c (renamed from src/lib/protocols/mdns.c)0
-rw-r--r--src/lib/protocols/snmp_proto.c (renamed from src/lib/protocols/snmp.c)0
-rw-r--r--src/lib/third_party/include/ht_hash.h (renamed from src/lib/third_party/include/hash.h)0
-rw-r--r--src/lib/third_party/include/ndpi_patricia.h2
-rw-r--r--src/lib/third_party/src/ht_hash.c (renamed from src/lib/third_party/src/hash.c)2
6 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 83094602d..760d29a26 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -43,7 +43,7 @@
#include "ndpi_content_match.c.inc"
#include "third_party/include/ndpi_patricia.h"
-#include "third_party/include/hash.h"
+#include "third_party/include/ht_hash.h"
#define NDPI_CONST_GENERIC_PROTOCOL_NAME "GenericProtocol"
@@ -741,7 +741,6 @@ void ndpi_init_protocol_match(struct ndpi_detection_module_struct *ndpi_mod,
u_int16_t no_master[2] = { NDPI_PROTOCOL_NO_MASTER_PROTO, NDPI_PROTOCOL_NO_MASTER_PROTO };
ndpi_port_range ports_a[MAX_DEFAULT_PORTS], ports_b[MAX_DEFAULT_PORTS];
static u_int16_t generic_id = NDPI_LAST_IMPLEMENTED_PROTOCOL;
- u_int16_t p_id;
if(ndpi_mod->proto_defaults[match->protocol_id].protoName == NULL) {
if(match->protocol_id == NDPI_PROTOCOL_GENERIC)
@@ -989,7 +988,6 @@ static void ndpi_validate_protocol_initialization(struct ndpi_detection_module_s
Do NOT add web services (NDPI_SERVICE_xxx) here.
*/
static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndpi_mod) {
- int i;
ndpi_port_range ports_a[MAX_DEFAULT_PORTS], ports_b[MAX_DEFAULT_PORTS];
u_int16_t no_master[2] = { NDPI_PROTOCOL_NO_MASTER_PROTO, NDPI_PROTOCOL_NO_MASTER_PROTO },
custom_master[2];
@@ -5706,7 +5704,7 @@ char* ndpi_strnstr(const char *s, const char *find, size_t slen) {
size_t len;
if((c = *find++) != '\0') {
- len = strlen(find);
+ len = strnlen(find, slen);
do {
do {
if(slen-- < 1 || (sc = *s++) == '\0')
@@ -5714,10 +5712,11 @@ char* ndpi_strnstr(const char *s, const char *find, size_t slen) {
} while (sc != c);
if(len > slen)
return (NULL);
- } while (strncmp(s, find, len) != 0);
+ } while(strncmp(s, find, len) != 0);
s--;
}
- return ((char *)s);
+
+ return((char *)s);
}
/* ****************************************************** */
diff --git a/src/lib/protocols/mdns.c b/src/lib/protocols/mdns_proto.c
index 77bdf4208..77bdf4208 100644
--- a/src/lib/protocols/mdns.c
+++ b/src/lib/protocols/mdns_proto.c
diff --git a/src/lib/protocols/snmp.c b/src/lib/protocols/snmp_proto.c
index 759d6bae0..759d6bae0 100644
--- a/src/lib/protocols/snmp.c
+++ b/src/lib/protocols/snmp_proto.c
diff --git a/src/lib/third_party/include/hash.h b/src/lib/third_party/include/ht_hash.h
index 2251706e4..2251706e4 100644
--- a/src/lib/third_party/include/hash.h
+++ b/src/lib/third_party/include/ht_hash.h
diff --git a/src/lib/third_party/include/ndpi_patricia.h b/src/lib/third_party/include/ndpi_patricia.h
index bb1806877..c61513f92 100644
--- a/src/lib/third_party/include/ndpi_patricia.h
+++ b/src/lib/third_party/include/ndpi_patricia.h
@@ -102,7 +102,7 @@ typedef struct the_prefix_t {
/* pointer to usr data (ex. route flap info) */
union patricia_node_value_t {
void *user_data;
- u_int32_t user_value;
+ unsigned int user_value;
};
typedef struct _patricia_node_t {
diff --git a/src/lib/third_party/src/hash.c b/src/lib/third_party/src/ht_hash.c
index 61ba9fbf6..4eaac9bcb 100644
--- a/src/lib/third_party/src/hash.c
+++ b/src/lib/third_party/src/ht_hash.c
@@ -7,7 +7,7 @@
#include <limits.h>
#include <string.h>
-#include "hash.h"
+#include "ht_hash.h"
/* #define HASH_DEBUG 1 */