summaryrefslogtreecommitdiff
path: root/bfd/simple.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2009-03-16 00:52:37 +0000
committerAlan Modra <amodra@bigpond.net.au>2009-03-16 00:52:37 +0000
commit27132992d347d3a7c9cc414318a8c77ef121cc1e (patch)
tree3c58b92d08443610f1fca0a064a0e5457498046d /bfd/simple.c
parent654caff2a03dcc81da639e3c2d1dc7711e989a47 (diff)
downloadbinutils-redhat-27132992d347d3a7c9cc414318a8c77ef121cc1e.tar.gz
* simple.c (bfd_simple_get_relocated_section_contents): Use larger
of rawsize and size for buffer.
Diffstat (limited to 'bfd/simple.c')
-rw-r--r--bfd/simple.c3
1 files changed, 2 insertions, 1 deletions
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;