s7comm: fix heap-overflow error
This commit is contained in:
@@ -31,7 +31,7 @@ void ndpi_search_s7comm_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int16_t s7comm_port = htons(102);
|
||||
if(packet->tcp) {
|
||||
|
||||
if((packet->payload[0]==0x03)&&(packet->payload[1]==0x00)&&((packet->tcp->dest == s7comm_port) || (packet->tcp->source == s7comm_port))) {
|
||||
if((packet->payload_packet_len >= 2) && (packet->payload[0]==0x03)&&(packet->payload[1]==0x00)&&((packet->tcp->dest == s7comm_port) || (packet->tcp->source == s7comm_port))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found S7\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_S7COMM, NDPI_PROTOCOL_UNKNOWN);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user