From 1a2185f4b1e64d5fb009959c3d29a48322a5c59c Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 18 Feb 2009 15:27:56 +0100 Subject: [PATCH] Fix operation of reloc functions when relocation data are absent --- src/dwarflint.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dwarflint.c b/src/dwarflint.c index 6952c90aa..87100fce9 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -2286,7 +2286,7 @@ relocation_next (struct relocation_data *reloc, uint64_t offset, GElf_Rela *rela_mem, struct where *where, enum skip_type st) { - if (reloc == NULL) + if (reloc == NULL || reloc->data == NULL) return NULL; while (reloc->index < reloc->count) @@ -2336,6 +2336,9 @@ static void relocation_skip (struct relocation_data *reloc, uint64_t offset, struct where *where, enum skip_type st) { + if (reloc == NULL || reloc->data == NULL) + return; + GElf_Rela rela_mem; relocation_next (reloc, offset - 1, &rela_mem, where, st); } @@ -2344,6 +2347,9 @@ relocation_skip (struct relocation_data *reloc, uint64_t offset, static void relocation_skip_rest (struct relocation_data *reloc, enum section_id sec) { + if (reloc == NULL || reloc->data == NULL) + return; + GElf_Rela rela_mem; relocation_next (reloc, (uint64_t)-1, &rela_mem, &WHERE (sec, NULL), skip_mismatched); -- 2.47.3