mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-28 01:50:48 +00: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user