TLS: fix heap-buffer-overflow error (#1408)

Detected by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43664
This commit is contained in:
Ivan Nardi
2022-01-15 18:47:59 +01:00
committed by GitHub
parent 63c44a24b6
commit eb5d7b07af
+2 -1
View File
@@ -2099,7 +2099,8 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
if(flow->protos.tls_quic.tls_supported_versions == NULL)
flow->protos.tls_quic.tls_supported_versions = ndpi_strdup(version_str);
}
} else if(extension_id == 65486 /* encrypted server name */) {
} else if(extension_id == 65486 /* encrypted server name */ &&
offset+extension_offset+1 < total_len) {
/*
- https://tools.ietf.org/html/draft-ietf-tls-esni-06
- https://blog.cloudflare.com/encrypted-sni/