diff options
author | Chih-Hung Hsieh <[email protected]> | 2015-09-09 13:59:19 -0700 |
---|---|---|
committer | Mark Wielaard <[email protected]> | 2015-09-10 14:02:24 +0200 |
commit | fc0a0f303bf31194c9cef9bb6a766cec9d7794fb (patch) | |
tree | 2204806401f1328709dba87e53732e659e15abea | |
parent | 4169187fe3abfda5b7df3eb39ab6bc15d08e13a1 (diff) |
Initialize variable before use.
Some compiler does not know that error function never returns.
Signed-off-by: Chih-Hung Hsieh <[email protected]>
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/readelf.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fb928075..238c4160 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2015-09-09 Chih-Hung Hsieh <[email protected]> + + * readelf.c (print_debug_exception_table): Initialize variable before + it is used, because compiler does not know that error never returns. + (dump_arhive_index): Likewise. + 2015-09-04 Chih-Hung Hsieh <[email protected]> * elflint.c (check_group): Replace %Z length modifier with %z. diff --git a/src/readelf.c b/src/readelf.c index 8e644003..33274f35 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -7910,6 +7910,7 @@ print_debug_exception_table (Dwfl_Module *dwflmod __attribute__ ((unused)), dsize = 8; break; default: + dsize = 0; error (1, 0, gettext ("invalid TType encoding")); } @@ -9567,7 +9568,7 @@ dump_archive_index (Elf *elf, const char *fname) { as_off = s->as_off; - Elf *subelf; + Elf *subelf = NULL; if (unlikely (elf_rand (elf, as_off) == 0) || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf)) == NULL)) |