Fix some compilation warnings

This commit is contained in:
Nardi Ivan
2020-04-20 16:53:39 +02:00
parent e603549967
commit b1a6c6b895
7 changed files with 17 additions and 12 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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}
};
/* ******************************************************************** */
+5
View File
@@ -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:
+4 -2
View File
@@ -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';