]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2011-03-05 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Sun, 6 Mar 2011 18:37:07 +0000 (18:37 +0000)
committerMichael Snyder <msnyder@vmware.com>
Sun, 6 Mar 2011 18:37:07 +0000 (18:37 +0000)
* compress.c (bfd_compress_section_contents): Check for out of mem.

bfd/ChangeLog
bfd/compress.c

index 63cd5f325ec8df96d922d6d73a56c07e2e67d3e2..31613e87fbfa3199c694fa84c27615a7eedb360d 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-06  Michael Snyder  <msnyder@vmware.com>
 
+       * compress.c (bfd_compress_section_contents): Check for out of mem.
+
        * elf64-x86-64.c (elf_x86_64_relocate_section): Document
        that case statement falls through intentionally.
 
index a526ea99c79822c171edce34106c27c354006a7f..669033c5ec54694c3ef6e90d11947ab9c2b0441c 100644 (file)
@@ -100,6 +100,9 @@ bfd_compress_section_contents (bfd *abfd ATTRIBUTE_UNUSED,
   compressed_size = compressBound (uncompressed_size) + 12;
   compressed_buffer = (bfd_byte *) bfd_malloc (compressed_size);
 
+  if (compressed_buffer == NULL)
+    return FALSE;
+
   if (compress ((Bytef*) compressed_buffer + 12,
                &compressed_size,
                (const Bytef*) uncompressed_buffer,