fuzz: improve fuzzing coverage (#2309)
This commit is contained in:
@@ -46,7 +46,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
*entry = fuzzed_data.ConsumeIntegral<u_int32_t>();
|
||||
|
||||
if(ndpi_tfind(entry, &root, __compare) == NULL) {
|
||||
if(ndpi_tsearch(entry, &root, __compare) == NULL) {
|
||||
if(ndpi_tsearch(entry, fuzzed_data.ConsumeBool() ? &root : NULL, __compare) == NULL) {
|
||||
ndpi_free(entry);
|
||||
} else {
|
||||
/* Keep one random entry really added */
|
||||
@@ -65,7 +65,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
for (i = 0; i < num_iteration; i++) {
|
||||
e = fuzzed_data.ConsumeIntegral<u_int32_t>();
|
||||
|
||||
ndpi_tfind(&e, &root, __compare);
|
||||
ndpi_tfind(&e, fuzzed_data.ConsumeBool() ? &root : NULL, __compare);
|
||||
}
|
||||
/* Search of an added node */
|
||||
if (is_added) {
|
||||
|
||||
Reference in New Issue
Block a user