Fixed new nDPi API
This commit is contained in:
@@ -4169,7 +4169,7 @@ int orginal_main(int argc, char **argv) {
|
||||
analyzeUnitTest();
|
||||
|
||||
gettimeofday(&startup_time, NULL);
|
||||
ndpi_info_mod = ndpi_init_detection_module(0 /* Don't skip tor hosts */);
|
||||
ndpi_info_mod = ndpi_init_detection_module(ndpi_no_prefs);
|
||||
|
||||
if(ndpi_info_mod == NULL) return -1;
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ fuzz_process_packet_LDFLAGS = ../src/lib/libndpi.a
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_process_packet_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
else
|
||||
fuzz_process_packet_SOURCES += onefile.c
|
||||
fuzz_process_packet_SOURCES += # onefile.c
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_process_packet_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
|
||||
+14
-14
@@ -9,20 +9,20 @@ struct ndpi_id_struct *src;
|
||||
struct ndpi_id_struct *dst;
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
if (ndpi_info_mod == NULL) {
|
||||
ndpi_info_mod = ndpi_init_detection_module();
|
||||
NDPI_PROTOCOL_BITMASK all;
|
||||
NDPI_BITMASK_SET_ALL(all);
|
||||
ndpi_set_protocol_detection_bitmask2(ndpi_info_mod, &all);
|
||||
ndpi_flow = ndpi_flow_malloc(SIZEOF_FLOW_STRUCT);
|
||||
src = ndpi_malloc(SIZEOF_ID_STRUCT);
|
||||
dst = ndpi_malloc(SIZEOF_ID_STRUCT);
|
||||
}
|
||||
if (ndpi_info_mod == NULL) {
|
||||
ndpi_info_mod = ndpi_init_detection_module(ndpi_no_prefs);
|
||||
NDPI_PROTOCOL_BITMASK all;
|
||||
NDPI_BITMASK_SET_ALL(all);
|
||||
ndpi_set_protocol_detection_bitmask2(ndpi_info_mod, &all);
|
||||
ndpi_flow = ndpi_flow_malloc(SIZEOF_FLOW_STRUCT);
|
||||
src = ndpi_malloc(SIZEOF_ID_STRUCT);
|
||||
dst = ndpi_malloc(SIZEOF_ID_STRUCT);
|
||||
}
|
||||
|
||||
memset(ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
|
||||
memset(src, 0, SIZEOF_ID_STRUCT);
|
||||
memset(dst, 0, SIZEOF_ID_STRUCT);
|
||||
ndpi_detection_process_packet(ndpi_info_mod, ndpi_flow, Data, Size, 0, src, dst);
|
||||
memset(ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
|
||||
memset(src, 0, SIZEOF_ID_STRUCT);
|
||||
memset(dst, 0, SIZEOF_ID_STRUCT);
|
||||
ndpi_detection_process_packet(ndpi_info_mod, ndpi_flow, Data, Size, 0, src, dst);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user