mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 10:03:47 +08:00
Re: USE_MMAP fuzzed object file attacks
I committed a broken patch. * aoutx.h (aout_get_external_symbols): Remove wrong #else and unneeded casts. * pdp11.c (aout_get_external_symbols): Likewise.
This commit is contained in:
parent
9fd82d9142
commit
0ab0435fe6
@ -1322,21 +1322,20 @@ aout_get_external_symbols (bfd *abfd)
|
||||
if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), amt,
|
||||
&obj_aout_sym_window (abfd), true))
|
||||
return false;
|
||||
syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
|
||||
syms = obj_aout_sym_window (abfd).data;
|
||||
}
|
||||
else
|
||||
#else
|
||||
#endif
|
||||
{
|
||||
/* We allocate using malloc to make the values easy to free
|
||||
later on. If we put them on the objalloc it might not be
|
||||
possible to free them. */
|
||||
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0)
|
||||
return false;
|
||||
syms = (struct external_nlist *) _bfd_malloc_and_read (abfd, amt, amt);
|
||||
syms = _bfd_malloc_and_read (abfd, amt, amt);
|
||||
if (syms == NULL)
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
obj_aout_external_syms (abfd) = syms;
|
||||
obj_aout_external_sym_count (abfd) = count;
|
||||
|
@ -1299,21 +1299,20 @@ aout_get_external_symbols (bfd *abfd)
|
||||
if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), amt,
|
||||
&obj_aout_sym_window (abfd), true))
|
||||
return false;
|
||||
syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
|
||||
syms = obj_aout_sym_window (abfd).data;
|
||||
}
|
||||
else
|
||||
#else
|
||||
#endif
|
||||
{
|
||||
/* We allocate using malloc to make the values easy to free
|
||||
later on. If we put them on the objalloc it might not be
|
||||
possible to free them. */
|
||||
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0)
|
||||
return false;
|
||||
syms = (struct external_nlist *) _bfd_malloc_and_read (abfd, amt, amt);
|
||||
syms = _bfd_malloc_and_read (abfd, amt, amt);
|
||||
if (syms == NULL)
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
obj_aout_external_syms (abfd) = syms;
|
||||
obj_aout_external_sym_count (abfd) = count;
|
||||
|
Loading…
Reference in New Issue
Block a user