aboutsummaryrefslogtreecommitdiff
path: root/bfd/simple.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-03-16 00:52:37 +0000
committerAlan Modra <amodra@gmail.com>2009-03-16 00:52:37 +0000
commit588f62fc9661c66df0713446bd6ba10a2a6cab9d (patch)
tree817791c056ab6a72335edf42d06fdc9b80218eff /bfd/simple.c
parentfc7593dfa0a2db5860f94f19ccae18737fbf7527 (diff)
downloadbinutils-588f62fc9661c66df0713446bd6ba10a2a6cab9d.zip
binutils-588f62fc9661c66df0713446bd6ba10a2a6cab9d.tar.gz
binutils-588f62fc9661c66df0713446bd6ba10a2a6cab9d.tar.bz2
* 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 dd69f9a..b0dec65 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;