read_cie
* dwarf.c (read_cie): Add more sanity checks to ensure data pointer is not bumped past end.
This commit is contained in:
parent
b495154607
commit
c93c4a8540
2 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2021-05-15 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* dwarf.c (read_cie): Add more sanity checks to ensure data
|
||||||
|
pointer is not bumped past end.
|
||||||
|
|
||||||
2021-05-15 Alan Modra <amodra@gmail.com>
|
2021-05-15 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* dwarf.c (display_debug_ranges): Delete initial_length_size.
|
* dwarf.c (display_debug_ranges): Delete initial_length_size.
|
||||||
|
|
|
@ -8409,10 +8409,16 @@ read_cie (unsigned char *start, unsigned char *end,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp (fc->augmentation, "eh") == 0)
|
if (strcmp (fc->augmentation, "eh") == 0)
|
||||||
start += eh_addr_size;
|
{
|
||||||
|
if (eh_addr_size > (size_t) (end - start))
|
||||||
|
goto fail;
|
||||||
|
start += eh_addr_size;
|
||||||
|
}
|
||||||
|
|
||||||
if (version >= 4)
|
if (version >= 4)
|
||||||
{
|
{
|
||||||
|
if (2 > (size_t) (end - start))
|
||||||
|
goto fail;
|
||||||
GET (fc->ptr_size, 1);
|
GET (fc->ptr_size, 1);
|
||||||
if (fc->ptr_size < 1 || fc->ptr_size > 8)
|
if (fc->ptr_size < 1 || fc->ptr_size > 8)
|
||||||
{
|
{
|
||||||
|
@ -8439,6 +8445,9 @@ read_cie (unsigned char *start, unsigned char *end,
|
||||||
READ_ULEB (fc->code_factor, start, end);
|
READ_ULEB (fc->code_factor, start, end);
|
||||||
READ_SLEB (fc->data_factor, start, end);
|
READ_SLEB (fc->data_factor, start, end);
|
||||||
|
|
||||||
|
if (start >= end)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
if (version == 1)
|
if (version == 1)
|
||||||
{
|
{
|
||||||
GET (fc->ra, 1);
|
GET (fc->ra, 1);
|
||||||
|
@ -8450,6 +8459,8 @@ read_cie (unsigned char *start, unsigned char *end,
|
||||||
|
|
||||||
if (fc->augmentation[0] == 'z')
|
if (fc->augmentation[0] == 'z')
|
||||||
{
|
{
|
||||||
|
if (start >= end)
|
||||||
|
goto fail;
|
||||||
READ_ULEB (augmentation_data_len, start, end);
|
READ_ULEB (augmentation_data_len, start, end);
|
||||||
augmentation_data = start;
|
augmentation_data = start;
|
||||||
/* PR 17512: file: 11042-2589-0.004. */
|
/* PR 17512: file: 11042-2589-0.004. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue