Additional memory bounds checks

This commit is contained in:
emanuele-f
2019-12-04 18:34:08 +01:00
parent f26096ee4c
commit 226a9abf22
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -874,7 +874,7 @@ int getSSCertificateFingerprint(struct ndpi_detection_module_struct *ndpi_struct
return(0); /* That's all */
} else if(flow->l4.tcp.tls_seen_certificate)
return(0); /* That's all */
else if(packet->payload_packet_len > flow->l4.tcp.tls_record_offset+7) {
else if(packet->payload_packet_len > flow->l4.tcp.tls_record_offset+7+1/* +1 because we are going to read 2 bytes */) {
/* This is a handshake but not a certificate record */
u_int16_t len = ntohs(*(u_int16_t*)&packet->payload[flow->l4.tcp.tls_record_offset+7]);