From: Alan Modra Date: Mon, 16 Mar 2009 00:52:37 +0000 (+0000) Subject: * simple.c (bfd_simple_get_relocated_section_contents): Use larger X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=588f62fc9661c66df0713446bd6ba10a2a6cab9d;p=deliverable%2Fbinutils-gdb.git * simple.c (bfd_simple_get_relocated_section_contents): Use larger of rawsize and size for buffer. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0aefc610bd..da22cb3037 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2009-03-16 Alan Modra + + * simple.c (bfd_simple_get_relocated_section_contents): Use larger + of rawsize and size for buffer. + 2009-03-15 Ulrich Weigand * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlay diff --git a/bfd/simple.c b/bfd/simple.c index dd69f9a559..b0dec657f9 100644 --- a/bfd/simple.c +++ b/bfd/simple.c @@ -210,7 +210,8 @@ bfd_simple_get_relocated_section_contents (bfd *abfd, data = NULL; if (outbuf == NULL) { - data = bfd_malloc (sec->size); + bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size; + data = bfd_malloc (amt); if (data == NULL) return NULL; outbuf = data;