Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numeric truncation at tls.c:1010 #2005

Merged
merged 2 commits into from
Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/lib/protocols/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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];
Expand Down