From 25c111191189f64c4077f9d0609b0fdbdc12c4ad Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:39:29 +0200 Subject: fuzz: add a new fuzzer triggering the payload analyzer function(s) (#1926) --- example/reader_util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'example/reader_util.c') diff --git a/example/reader_util.c b/example/reader_util.c index 76e54900f..3395153b0 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -266,16 +266,17 @@ void print_payload_stat(struct payload_stats *p) { /* ***************************************************** */ -void ndpi_report_payload_stats() { +void ndpi_report_payload_stats(int print) { struct payload_stats *p, *tmp; u_int num = 0; - printf("\n\nPayload Analysis\n"); + if(print) + printf("\n\nPayload Analysis\n"); HASH_SORT(pstats, payload_stats_sort_asc); HASH_ITER(hh, pstats, p, tmp) { - if(num <= max_num_reported_top_payloads) + if(print && num <= max_num_reported_top_payloads) print_payload_stat(p); ndpi_free(p->pattern); -- cgit v1.2.3