mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
Sanity check section size in bfd_init_section_compress_status
This function doesn't just initialise for compression, it actually compresses. This patch sanity checks section size before allocating buffers for the uncompressed contents. * compress.c (bfd_init_section_compress_status): Sanity check section size.
This commit is contained in:
@@ -1065,7 +1065,8 @@ bfd_init_section_compress_status (bfd *abfd, sec_ptr sec)
|
||||
|| sec->size == 0
|
||||
|| sec->rawsize != 0
|
||||
|| sec->contents != NULL
|
||||
|| sec->compress_status != COMPRESS_SECTION_NONE)
|
||||
|| sec->compress_status != COMPRESS_SECTION_NONE
|
||||
|| _bfd_section_size_insane (abfd, sec))
|
||||
{
|
||||
bfd_set_error (bfd_error_invalid_operation);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user