mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-25 06:09:50 +00:00
Import ia_fuzz from radare2-fuzz
This commit is contained in:
parent
b4ed2e26f0
commit
91738310b6
20
test/fuzz/fuzz_ia.c
Normal file
20
test/fuzz/fuzz_ia.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <r_core.h>
|
||||
|
||||
int LLVMFuzzerInitialize(int *lf_argc, char ***lf_argv) {
|
||||
r_log_set_quiet (true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
RCore *r = r_core_new();
|
||||
|
||||
r_core_cmdf(r, "o malloc://%zu", Size);
|
||||
r_io_write_at(r->io, 0, Data, Size);
|
||||
|
||||
r_core_cmd0(r, "oba 0");
|
||||
r_core_cmd0(r, "ia");
|
||||
|
||||
r_core_free(r);
|
||||
return 0;
|
||||
}
|
@ -2,6 +2,7 @@ if get_option('enable_libfuzzer')
|
||||
targets = [
|
||||
'bin',
|
||||
'bin_demangle',
|
||||
'ia',
|
||||
'pdb_parse',
|
||||
'pkcs7_parse',
|
||||
'protobuf_decode',
|
||||
@ -15,6 +16,7 @@ if get_option('enable_libfuzzer')
|
||||
include_directories: [platform_inc],
|
||||
dependencies: [
|
||||
r_bin_dep,
|
||||
r_core_dep,
|
||||
r_util_dep,
|
||||
r_socket_dep,
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user