fuzz: some enhancements (#1827)

Load some custom configuration (like in the unit tests) and factorize some
(fuzzing) common code.

There is no way to pass file paths to the fuzzers as parameters. The safe
solution seems to be to load them from the process working dir. Anyway,
missing file is not a blocking error.

Remove some dead code (found looking at the coverage report)
This commit is contained in:
Ivan Nardi
2022-12-10 19:49:11 +01:00
committed by GitHub
parent 8c7071e040
commit 48a7f6d487
27 changed files with 74 additions and 112 deletions
+1 -6
View File
@@ -30,11 +30,8 @@ static void ndpi_check_lotus_notes(struct ndpi_detection_module_struct *ndpi_str
struct ndpi_flow_struct *flow)
{
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
// const u_int8_t *packet_payload = packet->payload;
u_int32_t payload_len = packet->payload_packet_len;
if(packet->tcp == NULL) return;
flow->l4.tcp.lotus_notes_packet_id++;
if((flow->l4.tcp.lotus_notes_packet_id == 1) &&
@@ -58,9 +55,7 @@ void ndpi_search_lotus_notes(struct ndpi_detection_module_struct *ndpi_struct, s
{
NDPI_LOG_DBG(ndpi_struct, "search lotus_notes\n");
/* skip marked packets */
if(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_LOTUS_NOTES)
ndpi_check_lotus_notes(ndpi_struct, flow);
ndpi_check_lotus_notes(ndpi_struct, flow);
}