mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-11-24 04:29:49 +00:00
Fix mistake in recent code to check for an unterminated leb128 number.
* dwarf.c (read_leb128): Fix test for shift becoming too large.
This commit is contained in:
parent
9f04ac5f92
commit
f641dd969f
@ -668,8 +668,13 @@ do_define (unsigned int i, struct coff_scope *b)
|
||||
|
||||
if (!is->init)
|
||||
{
|
||||
long high = s->where->offset + s->type->size;
|
||||
|
||||
is->low = s->where->offset;
|
||||
is->high = s->where->offset + s->type->size;
|
||||
is->high = high;
|
||||
/* PR 17512: file: 37e7a80d. */
|
||||
if (is->high != high)
|
||||
fatal (_("Out of range type size: %u"), s->type->size);
|
||||
is->init = 1;
|
||||
is->parent = s->where->section;
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ read_leb128 (unsigned char *data,
|
||||
|
||||
/* PR 17512: file: 0ca183b8.
|
||||
FIXME: Should we signal this error somehow ? */
|
||||
if (shift >= sizeof (result))
|
||||
if (shift >= sizeof (result) * 8)
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user