mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
Fix an illegal memory access parsing a corrupt sysroff file.
PR 28564 * sysdump.c (getCHARS): Check for an out of bounds read.
This commit is contained in:
parent
5e97696c11
commit
d8ed269e5c
@ -1,3 +1,8 @@
|
||||
2021-11-24 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 28564
|
||||
* sysdump.c (getCHARS): Check for an out of bounds read.
|
||||
|
||||
2021-11-16 Fangrui Song <maskray@google.com>
|
||||
|
||||
* readelf.c (enum relocation_type): New.
|
||||
|
@ -60,6 +60,12 @@ getCHARS (unsigned char *ptr, int *idx, int size, int max)
|
||||
(*idx) += 8;
|
||||
}
|
||||
|
||||
if (oc + b > size)
|
||||
{
|
||||
/* PR 28564 */
|
||||
return _("*corrupt*");
|
||||
}
|
||||
|
||||
*idx += b * 8;
|
||||
r = xcalloc (b + 1, 1);
|
||||
memcpy (r, ptr + oc, b);
|
||||
|
Loading…
Reference in New Issue
Block a user