Skip to content

Commit

Permalink
TLS: fix another interger overflow in certificate processing (#1915)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi authored Mar 30, 2023
1 parent 9ea8a57 commit 6e0cd16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/protocols/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ void processCertificateElements(struct ndpi_detection_module_struct *ndpi_struct
if(flow->protos.tls_quic.server_names == NULL)
flow->protos.tls_quic.server_names = ndpi_strdup(dNSName),
flow->protos.tls_quic.server_names_len = strlen(dNSName);
else {
else if((u_int16_t)(flow->protos.tls_quic.server_names_len + dNSName_len + 1) > flow->protos.tls_quic.server_names_len) {
u_int16_t newstr_len = flow->protos.tls_quic.server_names_len + dNSName_len + 1;
char *newstr = (char*)ndpi_realloc(flow->protos.tls_quic.server_names,
flow->protos.tls_quic.server_names_len+1, newstr_len+1);
Expand Down

0 comments on commit 6e0cd16

Please sign in to comment.