aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2022-01-16 20:31:48 +0100
committerGitHub <noreply@github.com>2022-01-16 20:31:48 +0100
commit1ff308af0920deb5f14809947887967bdc3848cb (patch)
tree1bf079e2e9bf721e6c1c9a94497632886bc31c15
parent05734f3d314a31facbce61799b98206ccc5963a5 (diff)
TLS: fix a use-of-uninitialized-value error (#1411)
Detected by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43705
-rw-r--r--src/lib/protocols/tls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c
index cdaed66b2..fe28b8250 100644
--- a/src/lib/protocols/tls.c
+++ b/src/lib/protocols/tls.c
@@ -1870,7 +1870,8 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
printf("Client TLS Invalid len %u vs %u\n", s_offset+extension_len, total_len);
#endif
}
- } else if(extension_id == 13 /* signature algorithms */) {
+ } else if(extension_id == 13 /* signature algorithms */ &&
+ offset+extension_offset+1 < total_len) {
int s_offset = offset+extension_offset, safari_signature_algorithms = 0, chrome_signature_algorithms = 0,
duplicate_found = 0, last_signature = 0;
u_int16_t tot_signature_algorithms_len = ntohs(*((u_int16_t*)&packet->payload[s_offset]));