Merge pull request #1712 from IvanNardi/oss-fuzzer

HTTP, SoftEther, Florensia: fix some memory corruptions
This commit is contained in:
Toni
2022-08-24 11:24:25 +02:00
committed by GitHub
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -90,7 +90,8 @@ void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, str
ndpi_florensia_add_connection(ndpi_struct, flow);
return;
}
if (flow->packet_counter < 10 && get_l16(packet->payload, 0) == packet->payload_packet_len) {
if (flow->packet_counter < 10 && packet->payload_packet_len >=2 &&
get_l16(packet->payload, 0) == packet->payload_packet_len) {
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia\n");
return;
}
+2 -1
View File
@@ -855,7 +855,8 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
/* Matching on Content-Type.
OCSP: application/ocsp-request, application/ocsp-response
*/
if(strncmp((const char *)packet->content_line.ptr, "application/ocsp-", 17) == 0) {
if(packet->content_line.len > 17 &&
strncmp((const char *)packet->content_line.ptr, "application/ocsp-", 17) == 0) {
NDPI_LOG_DBG2(ndpi_struct, "Found OCSP\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OCSP, NDPI_PROTOCOL_HTTP, NDPI_CONFIDENCE_DPI);
}
+1 -1
View File
@@ -97,7 +97,7 @@ static size_t dissect_softether_type(enum softether_value_type t,
v->value.ptr.raw = payload + 4;
u_int32_t siz = ntohl(get_u_int32_t(payload, 0));
if(siz == 0 || (u_int64_t)payload_len < (u_int64_t)siz + 3)
if(siz == 0 || (u_int64_t)payload_len < (u_int64_t)siz + sizeof(siz))
return 0;
if(t == VALUE_DATA)