Warning fixes

This commit is contained in:
Luca Deri
2019-08-22 20:04:15 +02:00
parent 3d3cae1f20
commit 2134f83948
3 changed files with 9 additions and 7 deletions
-1
View File
@@ -242,7 +242,6 @@ int getTLScertificate(struct ndpi_detection_module_struct *ndpi_struct,
|| (handshake_protocol == 0x0b) /* Server Hello and Certificate message types are interesting for us */) {
u_int num_found = 0;
u_int16_t tls_version;
int i;
if(packet->tcp)
tls_version = ntohs(*((u_int16_t*)&packet->payload[header_len+4]));
+3 -2
View File
@@ -20,7 +20,7 @@ static void ndpi_int_tor_add_connection(struct ndpi_detection_module_struct
int ndpi_is_tls_tor(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, char *certificate) {
int prev_num = 0, numbers_found = 0, num_found = 0, i, len, num_impossible = 0;
int len;
char dummy[48], *dot, *name;
if((certificate == NULL) || (certificate[0] == '\0'))
@@ -51,6 +51,8 @@ int ndpi_is_tls_tor(struct ndpi_detection_module_struct *ndpi_struct,
len = strlen(name);
if(len >= 5) {
int i, prev_num = 0, numbers_found = 0, num_found = 0, num_impossible = 0;
for(i = 0; name[i+1] != '\0'; i++) {
// printf("***** [SSL] %s(): [%d][%c]", __FUNCTION__, i, name[i]);
@@ -66,7 +68,6 @@ int ndpi_is_tls_tor(struct ndpi_detection_module_struct *ndpi_struct,
}
} else
prev_num = 0;
if(ndpi_match_bigram(ndpi_struct, &ndpi_struct->bigrams_automa, &name[i])) {
num_found++;
+6 -4
View File
@@ -50,14 +50,16 @@ void ndpi_search_ubntac2(struct ndpi_detection_module_struct *ndpi_struct, struc
}
if(found) {
char version[256];
int i, j, len;
found += packet->payload[found+1] + 4; /* Skip model name */
found++; /* Skip len*/
if(found < packet->payload_packet_len) {
for(i=found, j=0; (packet->payload[i] != 0) && (i < packet->payload_packet_len) && (i < (sizeof(version)-1)); i++)
char version[256];
int i, j, len;
for(i=found, j=0; (i < packet->payload_packet_len)
&& (i < (sizeof(version)-1))
&& (packet->payload[i] != 0); i++)
version[j++] = packet->payload[i];
version[j] = '\0';