From ed51987e3a4838dd9aef27dfab2c0651f2f52836 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 18 Oct 2021 23:16:32 +0200 Subject: Fix broken fuzz_process_packet fuzzer by adding a call to ndpi_finalize_initialization(). (#1334) * fixed several memory errors (heap-overflow, unitialized memory, etc) * ability to build fuzz_process_packet with a main() allowing to replay crash data generated with fuzz_process_packet by LLVMs libfuzzer * temporarily disable fuzzing if `tests/do.sh` executed with env FUZZY_TESTING_ENABLED=1 Signed-off-by: Toni Uhlig --- src/lib/protocols/ppstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/protocols/ppstream.c') diff --git a/src/lib/protocols/ppstream.c b/src/lib/protocols/ppstream.c index 44eb812dc..91f66bee4 100644 --- a/src/lib/protocols/ppstream.c +++ b/src/lib/protocols/ppstream.c @@ -51,7 +51,7 @@ void ndpi_search_ppstream(struct ndpi_detection_module_struct /* check PPS over UDP */ if(packet->udp != NULL) { /*** on port 17788 ***/ - if(packet->payload_packet_len > 12 && ((ntohs(packet->udp->source) == PPS_PORT) || (ntohs(packet->udp->dest) == PPS_PORT))) { + if(packet->payload_packet_len > 14 && ((ntohs(packet->udp->source) == PPS_PORT) || (ntohs(packet->udp->dest) == PPS_PORT))) { if(((packet->payload_packet_len - 4 == get_l16(packet->payload, 0)) || (packet->payload_packet_len == get_l16(packet->payload, 0)) || (packet->payload_packet_len >= 6 && packet->payload_packet_len - 6 == get_l16(packet->payload, 0)))) { -- cgit v1.2.3