Fix potential illegal memory access in ZLIB because of an erroneous declaration of the size of the input buffer.

* compress.c (bfd_get_full_section_contents): Remember to reduce
	compressed size by the sizeof the compression header when
	decompressing the contents.
This commit is contained in:
Nick Clifton 2017-02-17 11:39:20 +00:00
parent 51547df62c
commit 6438d1be9e
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-02-17 Nick Clifton <nickc@redhat.com>
* compress.c (bfd_get_full_section_contents): Remember to reduce
compressed size by the sizeof the compression header when
decompressing the contents.
2017-02-17 Pedro Alves <palves@redhat.com>
* srec.c (Chunk): Rename to ...

View File

@ -300,7 +300,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
SHF_COMPRESSED section. */
compression_header_size = 12;
if (!decompress_contents (compressed_buffer + compression_header_size,
sec->compressed_size, p, sz))
sec->compressed_size - compression_header_size, p, sz))
{
bfd_set_error (bfd_error_bad_value);
if (p != *ptr)