summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2011-03-06 18:37:07 +0000
committerMichael Snyder <msnyder@specifix.com>2011-03-06 18:37:07 +0000
commit6163b7829ab7403041ad4e4b0a2f0791dca1602e (patch)
tree3a11436d07f09c83c57a41caad38b43bd9d34c68
parent64cfa2f8a5b9c9b0e93034e358e3b4c364fb7fd8 (diff)
downloadgdb-6163b7829ab7403041ad4e4b0a2f0791dca1602e.tar.gz
2011-03-05 Michael Snyder <msnyder@vmware.com>
* compress.c (bfd_compress_section_contents): Check for out of mem.
-rw-r--r--bfd/ChangeLog2
-rw-r--r--bfd/compress.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 63cd5f325ec..31613e87fbf 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/compress.c b/bfd/compress.c
index a526ea99c79..669033c5ec5 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -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,