DESCRIPTION
Return the size of the compression header of SEC in ABFD.
-
-RETURNS
- Return the size of the compression header in bytes.
*/
int
|| 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;
if (!bfd_get_section_contents (abfd, sec, uncompressed_buffer,
0, uncompressed_size))
- return false;
+ {
+ free (uncompressed_buffer);
+ return false;
+ }
sec->contents = uncompressed_buffer;
if (bfd_compress_section_contents (abfd, sec) == 0)