Commit Graph

6 Commits

Author SHA1 Message Date
Alan Modra 265c0fe0f2
binutils fuzzer trouble with getopt (#9976)
fuzz_objcopy.c calls copy_main that calls getopt. Without
reinitialisation of optind, this means that of the 100 iterations per
sample only the first would see the fake command line options. And if
another sample was then tested in the same running process, no iteration
would see the command line options. Fix this by setting optind. Do so
every second iteration because it's usefull to test with default options
too.

fuzz_addr2line set up five command line addresses but then only used
two. Fix that too, and use xmalloc/xstrdup so that malloc fails are
fatal.
2023-03-22 01:41:30 -07:00
Alan Modra 0f2fff3002
binutils/fuzz_objcopy memory leaks (#9796)
This should fix issue 49000, caused by not freeing symbol htabs. The
patch also removes some NULLing out of buffer pointers. These are all
cleared in init_objcopy_global_state.
2023-02-24 07:01:03 -08:00
Alan Modra d87ee00593
Call bfd_init on each test file (#9368)
bfd_init doesn't do much at the moment, but I'm planning on changing it
to re-initialise static state, with the aim of getting rid of some of
the flaky crashes reported by oss-fuzz.
2023-01-07 03:59:34 -08:00
DavidKorczynski a915e85916
binutils: add main_repo and clean up set up (#6697) 2021-10-30 16:07:37 +01:00
DavidKorczynski 9804465f3a
binutils: Extending and refining fuzzers (#6674)
Improve binutils fuzzing in three ways:
- Extend objdump and objcopy fuzzers. Make a version of objdump fuzzing
that is more stable
- New targetted disassembly fuzzer for mep architecture
- Include more extensive corpus

Signed-off-by: David Korczynski <david@adalogics.com>
2021-10-28 11:24:01 +01:00
DavidKorczynski 6e6e507f46
binutils: add objcopy fuzzer (#6635)
* binutils: add objcopy fuzzer

* binutils: objcopy fuzzer: fix docs

* binutils: objcopy: use right naming

* binutils: objcopy: fix styling

* binutils: disable leak deteection for objcopy fuzzer

* binutils: copy over all option files
2021-10-22 16:41:51 +00:00