Warning fix

This commit is contained in:
Luca Deri
2020-04-22 18:52:36 +02:00
parent 473a5d1d0b
commit 0b702c20d3
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -4213,7 +4213,7 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
As Google has recently introduced Duo,
we need to distinguish between it and hangout
thing that should be handled by the STUN dissector
*/
*/
ret.app_protocol = NDPI_PROTOCOL_HANGOUT_DUO;
}
}
+5 -5
View File
@@ -318,7 +318,7 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi
/* 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 */))
if(len == 0 /* Looks something went wrong */)
break;
strncpy(dNSName, (const char*)&packet->payload[i], len);
@@ -1111,17 +1111,17 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
#ifdef DEBUG_TLS
printf("Client SSL [TLS version len: %u]\n", version_len);
#endif
if(version_len == (extension_len-1)) {
u_int8_t j;
s_offset++;
// careful not to overflow and loop forever with u_int8_t
for(j=0; j+1<version_len; j += 2) {
u_int16_t tls_version = ntohs(*((u_int16_t*)&packet->payload[s_offset+j]));
u_int8_t unknown_tls_version;
#ifdef DEBUG_TLS
printf("Client SSL [TLS version: %s/0x%04X]\n",
ndpi_ssl_version2str(tls_version, &unknown_tls_version), tls_version);
@@ -1143,7 +1143,7 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
}
}
extension_offset += extension_len;
#ifdef DEBUG_TLS