Compilation fix

This commit is contained in:
Luca Deri
2020-02-28 15:28:41 +01:00
parent 9f72b15fff
commit 8f45f51e6c
+2 -1
View File
@@ -72,7 +72,8 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc
} else } else
bt_hash = (const char*)&flow->packet.payload[28]; bt_hash = (const char*)&flow->packet.payload[28];
if(bt_hash && flow->packet.payload_packet_len >= 20 + (bt_hash-flow->packet.payload)) memcpy(flow->protos.bittorrent.hash, bt_hash, 20); if(bt_hash && (flow->packet.payload_packet_len >= (20 + (bt_hash-(const char*)flow->packet.payload))))
memcpy(flow->protos.bittorrent.hash, bt_hash, 20);
} }
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN); ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);