aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2011-10-21 19:00:09 +0200
committerØyvind Harboe <oyvindharboe@gmail.com>2011-10-23 11:55:02 +0000
commit4e079d18bffaed0372ab5b2f13cfd5d14db79d21 (patch)
tree9744bdd6ed84db44253c3b711d116f37e7f886ce /src/target
parent0577ba8331080f57966d06e6aced1c061d228bb9 (diff)
clang: fix malloc() warning with assert
Change-Id: I989d2655622a9f11f4a0a2994014e42822587ecd Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/41 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/image.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/target/image.c b/src/target/image.c
index 21ce11f6..8f437c03 100644
--- a/src/target/image.c
+++ b/src/target/image.c
@@ -473,6 +473,8 @@ static int image_elf_read_headers(struct image *image)
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
image->num_sections++;
+ assert(image->num_sections > 0);
+
/**
* some ELF linkers produce binaries with *all* the program header
* p_paddr fields zero (there can be however one loadable segment