mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
Fix an illegal memory access parsing a win32pstatus note with a type of 0.
* elf.c (elfcore_grok_win32pstatus): Check for a note type of 0.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2021-01-14 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* elf.c (elfcore_grok_win32pstatus): Check for a note type of 0.
|
||||||
|
|
||||||
2021-01-13 Alan Modra <amodra@gmail.com>
|
2021-01-13 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* Makefile.in: Regenerate.
|
* Makefile.in: Regenerate.
|
||||||
|
@ -10163,7 +10163,8 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note)
|
|||||||
|
|
||||||
type = bfd_get_32 (abfd, note->descdata);
|
type = bfd_get_32 (abfd, note->descdata);
|
||||||
|
|
||||||
struct {
|
struct
|
||||||
|
{
|
||||||
const char *type_name;
|
const char *type_name;
|
||||||
unsigned long min_size;
|
unsigned long min_size;
|
||||||
} size_check[] =
|
} size_check[] =
|
||||||
@ -10174,7 +10175,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note)
|
|||||||
{ "NOTE_INFO_MODULE64", 16 },
|
{ "NOTE_INFO_MODULE64", 16 },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type > (sizeof(size_check)/sizeof(size_check[0])))
|
if (type == 0 || type > (sizeof(size_check)/sizeof(size_check[0])))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (note->descsz < size_check[type - 1].min_size)
|
if (note->descsz < size_check[type - 1].min_size)
|
||||||
|
Reference in New Issue
Block a user