Fixed invalid check

This commit is contained in:
Luca Deri
2020-04-15 22:42:09 +02:00
parent f4c24663fc
commit 287015ffdc
+1 -1
View File
@@ -80,7 +80,7 @@ static void ndpi_int_netbios_add_connection(struct ndpi_detection_module_struct
char name[64]; char name[64];
u_int off = flow->packet.payload[12] == 0x20 ? 12 : 14; u_int off = flow->packet.payload[12] == 0x20 ? 12 : 14;
if(off > flow->packet.payload_packet_len && if((off < flow->packet.payload_packet_len) &&
ndpi_netbios_name_interpret((char*)&flow->packet.payload[off], flow->packet.payload_packet_len - off, name, sizeof(name)) > 0) ndpi_netbios_name_interpret((char*)&flow->packet.payload[off], flow->packet.payload_packet_len - off, name, sizeof(name)) > 0)
snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name); snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);