forked from Imagelibrary/binutils-gdb
Fix a buffer overrun when parsing a corrupt MIPS ELF binary.
PR 21995 * readelf.c (process_mips_specific): Add checks for a NULL data pointer.
This commit is contained in:
@@ -15324,7 +15324,7 @@ process_mips_specific (FILE * file)
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
if (ent < end)
|
||||
if (data != NULL && ent < end)
|
||||
{
|
||||
printf (_(" Local entries:\n"));
|
||||
printf (" %*s %10s %*s\n",
|
||||
@@ -15854,7 +15854,7 @@ process_mips_specific (FILE * file)
|
||||
}
|
||||
printf ("\n");
|
||||
|
||||
if (ent < local_end)
|
||||
if (data != NULL && ent < local_end)
|
||||
{
|
||||
printf (_(" Local entries:\n"));
|
||||
printf (" %*s %10s %*s\n",
|
||||
@@ -15870,7 +15870,7 @@ process_mips_specific (FILE * file)
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
if (gotsym < symtabno)
|
||||
if (data != NULL && gotsym < symtabno)
|
||||
{
|
||||
int sym_width;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user