aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2020-04-15 18:07:24 +0200
committerNardi Ivan <nardi.ivan@gmail.com>2020-04-20 16:53:39 +0200
commitb1a6c6b8957b62ec8ada423abfdcfa5471c00147 (patch)
tree0d03df67b8fa0647050a74f473985301a027fa79 /src
parente60354996737df132ef4a2a681839e1bf403c296 (diff)
Fix some compilation warnings
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_typedefs.h2
-rw-r--r--src/lib/ndpi_content_match.c.inc2
-rw-r--r--src/lib/protocols/rx.c5
-rw-r--r--src/lib/protocols/tls.c6
4 files changed, 11 insertions, 4 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index 69b6b3641..261a05425 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -966,7 +966,7 @@ typedef struct ndpi_proto {
ndpi_protocol_category_t category;
} ndpi_protocol;
-#define NDPI_PROTOCOL_NULL { NDPI_PROTOCOL_UNKNOWN , NDPI_PROTOCOL_UNKNOWN }
+#define NDPI_PROTOCOL_NULL { NDPI_PROTOCOL_UNKNOWN , NDPI_PROTOCOL_UNKNOWN , NDPI_PROTOCOL_CATEGORY_UNSPECIFIED }
#define NUM_CUSTOM_CATEGORIES 5
#define CUSTOM_CATEGORY_LABEL_LEN 32
diff --git a/src/lib/ndpi_content_match.c.inc b/src/lib/ndpi_content_match.c.inc
index 3d207d0bb..410586fb7 100644
--- a/src/lib/ndpi_content_match.c.inc
+++ b/src/lib/ndpi_content_match.c.inc
@@ -9137,7 +9137,7 @@ static ndpi_protocol_match host_match[] = {
{ "brasilbandalarga.com.br", NULL, "brasilbandalarga\\.com" TLD, "EAQ", NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
{ ".eaqbr.com.br", NULL, "\\.eaqbr\\.com" TLD, "EAQ", NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
- { NULL, NULL, NULL, 0 }
+ { NULL, NULL, NULL, NULL, NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NDPI_PROTOCOL_SAFE}
};
/* ******************************************************************** */
diff --git a/src/lib/protocols/rx.c b/src/lib/protocols/rx.c
index 64dbe7d0f..3bcab3b85 100644
--- a/src/lib/protocols/rx.c
+++ b/src/lib/protocols/rx.c
@@ -129,19 +129,24 @@ void ndpi_check_rx(struct ndpi_detection_module_struct *ndpi_struct,
header->flags == PLUS_2 || header->flags == REQ_ACK ||
header->flags == MORE_1)
goto security;
+ /* Fall-through */
case ACK:
if(header->flags == CLIENT_INIT_1 || header->flags == CLIENT_INIT_2 ||
header->flags == EMPTY)
goto security;
+ /* Fall-through */
case CHALLENGE:
if(header->flags == EMPTY || header->call_number == 0)
goto security;
+ /* Fall-through */
case RESPONSE:
if(header->flags == EMPTY || header->call_number == 0)
goto security;
+ /* Fall-through */
case ACKALL:
if(header->flags == EMPTY)
goto security;
+ /* Fall-through */
case BUSY:
goto security;
case ABORT:
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c
index 560e483ac..a6d7883ce 100644
--- a/src/lib/protocols/tls.c
+++ b/src/lib/protocols/tls.c
@@ -316,8 +316,10 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi
i += 2;
- if((len > sizeof(dNSName)-1) || (len == 0 /* Looks something went wrong */))
- break; /* String too long */
+ /* The check "len > sizeof(dNSName) - 1" will be always false. If we add it,
+ the compiler is smart enough to detect it and throws a warning */
+ if((len == 0 /* Looks something went wrong */))
+ break;
strncpy(dNSName, (const char*)&packet->payload[i], len);
dNSName[len] = '\0';