diff options
author | Toni <matzeton@googlemail.com> | 2021-06-29 15:33:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 15:33:12 +0200 |
commit | ced6fca184a4549333c2d582e53419f66cd99ec1 (patch) | |
tree | 989d972da84d5958191f4318c7b2e474f890f0cf /src/lib/protocols/tls.c | |
parent | 8222ac5bdc5f9bb1ea1e2fcdd5733cd3241aa617 (diff) |
Fixed off-by-one memory error for TLS-JA3. (#1222)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/protocols/tls.c')
-rw-r--r-- | src/lib/protocols/tls.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index 4f376a4ff..ed3caed5f 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -1849,7 +1849,11 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct, duplicate_found); #endif - ja3.client.signature_algorithms[i*2] = '\0'; + if (i == tot_signature_algorithms_len) { + ja3.client.signature_algorithms[i*2 - 1] = '\0'; + } else { + ja3.client.signature_algorithms[i*2] = '\0'; + } #ifdef DEBUG_TLS printf("Client TLS [SIGNATURE_ALGORITHMS: %s]\n", ja3.client.signature_algorithms); |