fuzz: add a new fuzzer testing memory allocation failures (#1818)
Try to fuzz error paths triggered by allocation errors. Fix some errors already found by this new fuzzer. Basic idea taken from: https://github.com/harfbuzz/harfbuzz/pull/2566/files `FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION` is a standard define used to (not)compile specific code in fuzzing builds. See: https://llvm.org/docs/LibFuzzer.html
This commit is contained in:
@@ -131,8 +131,9 @@ void * ndpi_tsearch(const void *vkey, void **vrootp,
|
||||
*rootp = q; /* link new node to old */
|
||||
q->key = key; /* initialize new node */
|
||||
q->left = q->right = (ndpi_node *)0;
|
||||
return ((void *)q->key);
|
||||
}
|
||||
return ((void *)q->key);
|
||||
return ((void *)0);
|
||||
}
|
||||
|
||||
/* ****************************************** */
|
||||
|
||||
Reference in New Issue
Block a user