* simple.c (bfd_simple_get_relocated_section_contents): Use larger
authorAlan Modra <amodra@gmail.com>
Mon, 16 Mar 2009 00:52:37 +0000 (00:52 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 16 Mar 2009 00:52:37 +0000 (00:52 +0000)
of rawsize and size for buffer.

bfd/ChangeLog
bfd/simple.c

index 0aefc610bd225ab1851d3228f5face8d7ac7259b..da22cb3037ed9a6574efaf459d57a17f7e3f9cd2 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-16  Alan Modra  <amodra@bigpond.net.au>
+
+       * simple.c (bfd_simple_get_relocated_section_contents): Use larger
+       of rawsize and size for buffer.
+
 2009-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlay
index dd69f9a55964670b8a62e2487c27676f871c9679..b0dec657f9ca0fa265c1c80762529d4ea687349e 100644 (file)
@@ -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;
This page took 0.026301 seconds and 4 git commands to generate.