(off_t)elf_getu(swap, elfhdr.e_phoff),
elf_getu16(swap, elfhdr.e_phnum),
(size_t)elf_getu16(swap, elfhdr.e_phentsize),
- fsize, &flags) == -1)
+ fsize, &flags, elf_getu16(swap, elfhdr.e_shnum))
+ == -1)
return -1;
/*FALLTHROUGH*/
case ET_REL:
#include "magic.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.73 2008/03/27 22:00:28 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.74 2008/05/28 21:02:29 christos Exp $")
#endif
#ifdef ELFCORE
off_t, int *);
#endif
private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t,
- off_t, int *);
+ off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t, int *,
int);
private size_t donote(struct magic_set *, unsigned char *, size_t, size_t, int,
*/
private int
dophn_exec(struct magic_set *ms, int class, int swap, int fd, off_t off,
- int num, size_t size, off_t fsize, int *flags)
+ int num, size_t size, off_t fsize, int *flags, int sh_num)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
return -1;
align = 4;
}
+ if (sh_num)
+ break;
/*
* This is a PT_NOTE section; loop through all the notes
* in the section.