Fix memory leak (#2340)
```
Direct leak of 12 byte(s) in 1 object(s) allocated from:
#0 0x55779e1a46ff in malloc (/home/ivan/svnrepos/nDPI/example/ndpiReader+0x8706ff) (BuildId: 14c2fc626744710d49d652ea1c5bbb24a8cbab4f)
#1 0x55779e2120c7 in ndpi_malloc_wrapper /home/ivan/svnrepos/nDPI/example/ndpiReader.c:298:10
#2 0x55779e5fa215 in ndpi_malloc /home/ivan/svnrepos/nDPI/src/lib/ndpi_memory.c:60:25
#3 0x55779e5fa500 in ndpi_strdup /home/ivan/svnrepos/nDPI/src/lib/ndpi_memory.c:113:13
#4 0x55779e42153c in processClientServerHello /home/ivan/svnrepos/nDPI/src/lib/protocols/tls.c:2554:46
#5 0x55779e4359a1 in processTLSBlock /home/ivan/svnrepos/nDPI/src/lib/protocols/tls.c:908:5
#6 0x55779e432de7 in ndpi_search_tls_tcp /home/ivan/svnrepos/nDPI/src/lib/protocols/tls.c:1097:2
#7 0x55779e4133f9 in ndpi_search_tls_wrapper /home/ivan/svnrepos/nDPI/src/lib/protocols/tls.c:2913:5
```
Found by oss-fuzz
See: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=67250
This commit is contained in:
+1
-1
@@ -7413,7 +7413,7 @@ static void ndpi_reconcile_protocols(struct ndpi_detection_module_struct *ndpi_s
|
||||
}
|
||||
} else if(flow->guessed_protocol_id_by_ip == NDPI_PROTOCOL_TELEGRAM) {
|
||||
ndpi_int_change_protocol(ndpi_str, flow,
|
||||
flow->guessed_protocol_id_by_ip, flow->detected_protocol_stack[1],
|
||||
flow->guessed_protocol_id_by_ip, flow->detected_protocol_stack[0],
|
||||
NDPI_CONFIDENCE_DPI_PARTIAL);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2615,7 +2615,7 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_TLS
|
||||
printf("Client TLS [SUPPORTED_VERSIONS: %s]\n", ja.client.supported_versions_str);
|
||||
printf("Client TLS [SUPPORTED_VERSIONS: %s]\n", version_str);
|
||||
#endif
|
||||
|
||||
if(flow->protos.tls_quic.tls_supported_versions == NULL)
|
||||
|
||||
Reference in New Issue
Block a user