aboutsummaryrefslogtreecommitdiff
path: root/fuzz/fuzz_filecfg_categories.c
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2024-01-10 11:19:44 +0100
committerIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-01-18 10:21:24 +0100
commit6c85f10cd5a29346522ad647a38066f0cc44e5a7 (patch)
tree062db3a48785916f4532ca712ad0ea41698f952c /fuzz/fuzz_filecfg_categories.c
parentc704be1a20d169bea1c55a720421742f09f4aa88 (diff)
config: move debug/log configuration to the new API
Diffstat (limited to 'fuzz/fuzz_filecfg_categories.c')
-rw-r--r--fuzz/fuzz_filecfg_categories.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fuzz/fuzz_filecfg_categories.c b/fuzz/fuzz_filecfg_categories.c
index 17947b58c..dd782ff67 100644
--- a/fuzz/fuzz_filecfg_categories.c
+++ b/fuzz/fuzz_filecfg_categories.c
@@ -6,7 +6,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
struct ndpi_detection_module_struct *ndpi_struct;
FILE *fd;
NDPI_PROTOCOL_BITMASK all;
- NDPI_PROTOCOL_BITMASK debug_bitmask;
/* To allow memory allocation failures */
fuzz_set_alloc_callbacks_and_seed(size);
@@ -15,17 +14,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
NDPI_BITMASK_SET_ALL(all);
ndpi_set_protocol_detection_bitmask2(ndpi_struct, &all);
- NDPI_BITMASK_SET_ALL(debug_bitmask);
- ndpi_set_log_level(ndpi_struct, 4);
- ndpi_set_debug_bitmask(ndpi_struct, debug_bitmask);
+ ndpi_set_config(ndpi_struct, NULL, "log.level", "3");
+ ndpi_set_config(ndpi_struct, "all", "log.enable", "1");
fd = buffer_to_file(data, size);
load_categories_file_fd(ndpi_struct, fd, NULL);
if(fd)
fclose(fd);
- /* We don't really need to call ndpi_finalize_initialization */
-
ndpi_exit_detection_module(ndpi_struct);
return 0;
}