Skip to content

Commit

Permalink
Fix infinite loop in tls
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Mar 12, 2020
1 parent 9d1340a commit 7806eb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/protocols/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,8 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,

s_offset++;

for(j=0; j<version_len; j += 2) {
// careful not to overflow and loop forever with u_int8_t
for(j=0; j+1<version_len; j += 2) {
u_int16_t tls_version = ntohs(*((u_int16_t*)&packet->payload[s_offset+j]));
u_int8_t unknown_tls_version;

Expand Down

0 comments on commit 7806eb5

Please sign in to comment.