mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 20:28:28 +08:00
Fix invalid read of section contents whilst processing a corrupt binary.
PR binutils/21135 * readelf.c (dump_section_as_bytes): Handle the case where uncompress_section_contents returns false.
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
2017-02-13 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21135
|
||||
* readelf.c (dump_section_as_bytes): Handle the case where
|
||||
uncompress_section_contents returns false.
|
||||
|
||||
2017-02-13 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21149
|
||||
|
@ -12825,10 +12825,18 @@ dump_section_as_bytes (Elf_Internal_Shdr * section,
|
||||
new_size -= 12;
|
||||
}
|
||||
|
||||
if (uncompressed_size
|
||||
&& uncompress_section_contents (& start, uncompressed_size,
|
||||
if (uncompressed_size)
|
||||
{
|
||||
if (uncompress_section_contents (& start, uncompressed_size,
|
||||
& new_size))
|
||||
section_size = new_size;
|
||||
else
|
||||
{
|
||||
error (_("Unable to decompress section %s\n"),
|
||||
printable_section_name (section));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (relocate)
|
||||
|
Reference in New Issue
Block a user