mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-17 12:53:17 +08:00
PR ld/12451
* elfcode.h (elf_checksum_contents): Read in the section's contents if they are not already available. * compress.c (bfd_get_full_section_contents): Use zmalloc to allocate the buffers so that excess bytes are guaranteed to be zero.
This commit is contained in:
@ -181,7 +181,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
|
||||
case COMPRESS_SECTION_NONE:
|
||||
if (p == NULL)
|
||||
{
|
||||
p = (bfd_byte *) bfd_malloc (sz);
|
||||
p = (bfd_byte *) bfd_zmalloc (sz);
|
||||
if (p == NULL)
|
||||
return FALSE;
|
||||
}
|
||||
@ -221,7 +221,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
|
||||
if (!ret)
|
||||
goto fail_compressed;
|
||||
|
||||
uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size);
|
||||
uncompressed_buffer = (bfd_byte *) bfd_zmalloc (uncompressed_size);
|
||||
if (uncompressed_buffer == NULL)
|
||||
goto fail_compressed;
|
||||
|
||||
|
Reference in New Issue
Block a user