Adds bound check in oracle protocol

Found by oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21780
This commit is contained in:
Philippe Antoine
2020-05-10 15:04:23 +02:00
parent 39ae57e6a3
commit b69177be2f
+1 -1
View File
@@ -43,7 +43,7 @@ void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct
NDPI_LOG_DBG2(ndpi_struct, "calculating ORACLE over tcp\n");
/* Oracle Database 9g,10g,11g */
if ((dport == 1521 || sport == 1521)
&& (((packet->payload[0] == 0x07) && (packet->payload[1] == 0xff) && (packet->payload[2] == 0x00))
&& (((packet->payload_packet_len >= 3 && packet->payload[0] == 0x07) && (packet->payload[1] == 0xff) && (packet->payload[2] == 0x00))
|| ((packet->payload_packet_len >= 232) && ((packet->payload[0] == 0x00) || (packet->payload[0] == 0x01))
&& (packet->payload[1] != 0x00)
&& (packet->payload[2] == 0x00)