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:
+3
-4
@@ -5100,11 +5100,10 @@ void ndpi_free_flow_data(struct ndpi_flow_struct* flow) {
|
||||
}
|
||||
|
||||
if(flow->l4_proto == IPPROTO_UDP) {
|
||||
if(flow->l4.udp.quic_reasm_buf){
|
||||
if(flow->l4.udp.quic_reasm_buf)
|
||||
ndpi_free(flow->l4.udp.quic_reasm_buf);
|
||||
if(flow->l4.udp.quic_reasm_buf_bitmap)
|
||||
ndpi_free(flow->l4.udp.quic_reasm_buf_bitmap);
|
||||
}
|
||||
if(flow->l4.udp.quic_reasm_buf_bitmap)
|
||||
ndpi_free(flow->l4.udp.quic_reasm_buf_bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user