mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
Fix an undefined behaviour in the BFD library's DWARF parser.
PR 28687 * dwarf1.c (parse_die): Fix undefined behaviour in range tests.
This commit is contained in:
parent
161e87d121
commit
4d3605c8ca
@ -1,3 +1,8 @@
|
||||
2021-12-15 Nikita Popov <npv1310@gmail.com>
|
||||
|
||||
PR 28687
|
||||
* dwarf1.c (parse_die): Fix undefined behaviour in range tests.
|
||||
|
||||
2021-11-17 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 28452
|
||||
|
@ -258,8 +258,7 @@ parse_die (bfd * abfd,
|
||||
if (xptr + 2 <= aDiePtrEnd)
|
||||
{
|
||||
block_len = bfd_get_16 (abfd, xptr);
|
||||
if (xptr + block_len > aDiePtrEnd
|
||||
|| xptr + block_len < xptr)
|
||||
if ((unsigned int) (aDiePtrEnd - xptr) < block_len)
|
||||
return false;
|
||||
xptr += block_len;
|
||||
}
|
||||
@ -269,8 +268,7 @@ parse_die (bfd * abfd,
|
||||
if (xptr + 4 <= aDiePtrEnd)
|
||||
{
|
||||
block_len = bfd_get_32 (abfd, xptr);
|
||||
if (xptr + block_len > aDiePtrEnd
|
||||
|| xptr + block_len < xptr)
|
||||
if ((unsigned int) (aDiePtrEnd - xptr) < block_len)
|
||||
return false;
|
||||
xptr += block_len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user