summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/cbfs-mkpayload.c
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2009-09-17 15:35:08 +0000
committerRonald G. Minnich <rminnich@gmail.com>2009-09-17 15:35:08 +0000
commit5a1af7b877192143fdb12f98062caa458a1e02e0 (patch)
tree51f89a84e62092752d5ed181dc20c4264042dddf /util/cbfstool/cbfs-mkpayload.c
parentb796a06cc6daa6cc7ee379fb64faa854f06556ff (diff)
downloadcoreboot-5a1af7b877192143fdb12f98062caa458a1e02e0.tar.gz
coreboot-5a1af7b877192143fdb12f98062caa458a1e02e0.tar.bz2
coreboot-5a1af7b877192143fdb12f98062caa458a1e02e0.zip
There was a missing addition of the size of the .notes.pinfo
section header which could lead to corrupted malloc arena. Also, make cbfstool always build with debugging on. Performance is not an issue here. Don't strip it either. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4641 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/cbfstool/cbfs-mkpayload.c')
-rw-r--r--util/cbfstool/cbfs-mkpayload.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c
index 4f0e2481234f..f8cc1616b044 100644
--- a/util/cbfstool/cbfs-mkpayload.c
+++ b/util/cbfstool/cbfs-mkpayload.c
@@ -75,8 +75,10 @@ int parse_elf_to_payload(unsigned char *input, unsigned char **output,
name = (char *)(strtab + shdr[i].sh_name);
- if (!strcmp(name, ".note.pinfo"))
+ if (!strcmp(name, ".note.pinfo")) {
segments++;
+ isize += (unsigned int)shdr[i].sh_size;
+ }
}
/* Now, regular headers - we only care about PT_LOAD headers,