diff options
author | headshog <124502670+headshog@users.noreply.github.com> | 2023-06-08 08:52:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 07:52:18 +0200 |
commit | 7dcceb4daf1600915cb508ba7eff872699526a93 (patch) | |
tree | 86bdf5156b719c0bcb85b6925f55104df52dddc0 /src/lib/protocols/tls.c | |
parent | 436ab54f5a82f9113bb52f9fbba3971c4d7b176b (diff) |
Numeric truncation at `tls.c:1010` (#2005)
* fixed numtrunc error in protocols/tls.c
* fixed build error for tls.c
Diffstat (limited to 'src/lib/protocols/tls.c')
-rw-r--r-- | src/lib/protocols/tls.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index 58b19d0d5..45965f62d 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -1000,7 +1000,8 @@ static int ndpi_search_tls_tcp(struct ndpi_detection_module_struct *ndpi_struct, } while(!something_went_wrong) { - u_int16_t len, p_len; + u_int32_t len; + u_int16_t p_len; const u_int8_t *p; u_int8_t content_type; @@ -1072,7 +1073,7 @@ static int ndpi_search_tls_tcp(struct ndpi_detection_module_struct *ndpi_struct, && (content_type != 0x17 /* Application Data */) && (!flow->tls_quic.certificate_processed)) { /* Split the element in blocks */ - u_int16_t processed = 5; + u_int32_t processed = 5; while((processed+4) <= len) { const u_int8_t *block = (const u_int8_t *)&message->buffer[processed]; |