From 5584136b697ed99e2d88f1b78f3722e22754f265 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Wed, 18 Jul 2012 14:00:16 +1200 Subject: [PATCH] elf32: stop section extraction after the first error. --- formats/elf32.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/formats/elf32.c b/formats/elf32.c index b587d7a..9a2f51b 100644 --- a/formats/elf32.c +++ b/formats/elf32.c @@ -331,8 +331,10 @@ int elf32_extract(FILE *in, binfile_imgcb_t cb, void *user_data) Elf32_Shdr *s = &info.file_shdrs[i]; if (s->sh_type == SHT_PROGBITS && s->sh_flags & SHF_ALLOC && - feed_section(&info, in, s, cb, user_data) < 0) + feed_section(&info, in, s, cb, user_data) < 0) { ret = -1; + break; + } } if (info.string_tab)