Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_addr2line.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size > 16384)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
FILE *fp = fopen(filename, "wb");
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_as.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ xatexit (void (*fn) (void) ATTRIBUTE_UNUSED)

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (size > 1024)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer-%d.s", getpid());
FILE *fp = fopen(filename, "wb");
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ static int bufferToFile(char * name, const uint8_t *Data, size_t Size) {
char *target = NULL;

int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size > 16384)
return 0;
char tmpfilename[32];

if (bfd_init() != BFD_INIT_MAGIC)
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_bfd_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ static int bufferToFile(char *name, const uint8_t *Data, size_t Size) {
}

int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size > 16384)
return 0;
char tmpfilename[32];

if (bfd_init() != BFD_INIT_MAGIC)
Expand Down
3 changes: 1 addition & 2 deletions projects/binutils/fuzz_dlltool.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size < 512) {
if (size < 512 || size > 16384)
return 0;
}

/* def file */
char filename[256];
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size > 16384)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
FILE *fp = fopen(filename, "wb");
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_nm.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size > 16384)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
FILE *fp = fopen(filename, "wb");
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_objcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ init_objcopy_global_state() {
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size > 16384)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
FILE *fp = fopen(filename, "wb");
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_objdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size > 16384)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
FILE *fp = fopen(filename, "wb");
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_ranlib_simulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size > 16384)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
FILE *fp = fopen(filename, "wb");
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_readelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ int check_architecture(char *tmpfilename, char *arch_string) {

int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (size > 16384)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());

Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size > 16384)
return 0;
char filename[256];
sprintf(filename, "/tmp/libfuzzer.%d", getpid());
FILE *fp = fopen(filename, "wb");
Expand Down
2 changes: 2 additions & 0 deletions projects/binutils/fuzz_windres.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size > 16384)
return 0;
enum res_format input_format;
input_format = fuzz_format_check_from_mem(data, size);;
if (input_format != RES_FORMAT_COFF) {
Expand Down
Loading