summaryrefslogtreecommitdiff
path: root/src/elflint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/elflint.c')
-rw-r--r--src/elflint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/elflint.c b/src/elflint.c
index 66a13ca2..76fb1a0c 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -1959,7 +1959,8 @@ section [%2d] '%s': extended section index in section [%2zu] '%s' refers to same
return;
}
- if (*((Elf32_Word *) data->d_buf) != 0)
+ if (data->d_size < sizeof (Elf32_Word)
+ || *((Elf32_Word *) data->d_buf) != 0)
ERROR (gettext ("symbol 0 should have zero extended section index\n"));
for (size_t cnt = 1; cnt < data->d_size / sizeof (Elf32_Word); ++cnt)