TLS, H323, examples: fix some memory errors (#1414)
Detected by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26880 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26906 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43782 https://oss-fuzz.com/testcase-detail/6334089358082048
This commit is contained in:
@@ -46,7 +46,7 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
||||
NDPI_LOG_DBG2(ndpi_struct, "calculated dport over tcp\n");
|
||||
|
||||
/* H323 */
|
||||
if(packet->payload_packet_len > 4
|
||||
if(packet->payload_packet_len > 5
|
||||
&& (packet->payload[0] == 0x03)
|
||||
&& (packet->payload[1] == 0x00)) {
|
||||
struct tpkt *t = (struct tpkt*)packet->payload;
|
||||
|
||||
@@ -2145,11 +2145,11 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
int rc = sprintf(&flow->protos.tls_quic.encrypted_sni.esni[off], "%02X", packet->payload[i] & 0XFF);
|
||||
|
||||
if(rc <= 0) {
|
||||
flow->protos.tls_quic.encrypted_sni.esni[off] = '\0';
|
||||
break;
|
||||
} else
|
||||
off += rc;
|
||||
}
|
||||
flow->protos.tls_quic.encrypted_sni.esni[off] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user