Add a reasonable bound on the symbol table index size.
This commit is contained in:
parent
d01f7b29a9
commit
1f7967e13b
@ -143,10 +143,12 @@ load_symtab(Elf *e, struct symtab *symtab, u_long sh_type)
|
||||
if (scn == NULL)
|
||||
return (-1);
|
||||
|
||||
if ((symtab->data = elf_getdata(scn, NULL)) == NULL)
|
||||
nsyms = shdr.sh_size / shdr.sh_entsize;
|
||||
if (nsyms > (1 << 20))
|
||||
return (-1);
|
||||
|
||||
nsyms = shdr.sh_size / shdr.sh_entsize;
|
||||
if ((symtab->data = elf_getdata(scn, NULL)) == NULL)
|
||||
return (-1);
|
||||
|
||||
symtab->index = calloc(nsyms, sizeof(u_int));
|
||||
if (symtab->index == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user