mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
libelf: section index 0 is special
When iterating over sections, table entry zero needs to be ignored. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
1 parent
bb5910ff0f
commit
41fe9cabf2
3 files changed
+3
-3
No files matched your search
@@ -536,7 +536,7 @@ elf_errorstatus elf_xen_parse(struct elf_binary *elf,
|
||||
if ( xen_elfnotes == 0 )
|
||||
{
|
||||
count = elf_shdr_count(elf);
|
||||
for ( i = 0; i < count; i++ )
|
||||
for ( i = 1; i < count; i++ )
|
||||
{
|
||||
shdr = elf_shdr_by_index(elf, i);
|
||||
if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
|
||||
|
||||
@@ -79,7 +79,7 @@ elf_errorstatus elf_init(struct elf_binary *elf, const char *image_input, size_t
|
||||
|
||||
/* Find symbol table and symbol string table. */
|
||||
count = elf_shdr_count(elf);
|
||||
for ( i = 0; i < count; i++ )
|
||||
for ( i = 1; i < count; i++ )
|
||||
{
|
||||
shdr = elf_shdr_by_index(elf, i);
|
||||
if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
|
||||
|
||||
@@ -153,7 +153,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
|
||||
const char *sname;
|
||||
unsigned i;
|
||||
|
||||
for ( i = 0; i < count; i++ )
|
||||
for ( i = 1; i < count; i++ )
|
||||
{
|
||||
shdr = elf_shdr_by_index(elf, i);
|
||||
if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
|
||||
|
||||