aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2021-07-05 09:42:52 +0200
committerGitHub <noreply@github.com>2021-07-05 09:42:52 +0200
commit46c32d2433c3350b05750a0dbcdcfa94809771c4 (patch)
tree4114a9bef4c2339928febb7e90d50c81a3a0f23c /src
parent1116d0e4b1c27b26c3e2ac359331cc5ca2ffa868 (diff)
TLS: fix a memory error in JA3 code (#1227)
protocols/tls.c:1856:5: runtime error: index 256 out of bounds for type 'char [256]' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior protocols/tls.c:1856:5
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c
index ed3caed5f..c1c31d5bc 100644
--- a/src/lib/protocols/tls.c
+++ b/src/lib/protocols/tls.c
@@ -1849,7 +1849,7 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
duplicate_found);
#endif
- if (i == tot_signature_algorithms_len) {
+ if (i >= tot_signature_algorithms_len) {
ja3.client.signature_algorithms[i*2 - 1] = '\0';
} else {
ja3.client.signature_algorithms[i*2] = '\0';