projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AArch64: Add negative tests for Armv8.3-a complex number instructions instructions.
[deliverable/binutils-gdb.git]
/
bfd
/
dwarf1.c
diff --git
a/bfd/dwarf1.c
b/bfd/dwarf1.c
index 71bc57bfdf825092c3449ba8810b0efa7b54bb8b..1fd21e32ede5120061a2d2179129e1d89ebbc1dd 100644
(file)
--- a/
bfd/dwarf1.c
+++ b/
bfd/dwarf1.c
@@
-1,5
+1,5
@@
/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
- Copyright (C) 1998-201
8
Free Software Foundation, Inc.
+ Copyright (C) 1998-201
9
Free Software Foundation, Inc.
Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
@@
-213,6
+213,7
@@
parse_die (bfd * abfd,
/* Then the attributes. */
while (xptr + 2 <= aDiePtrEnd)
{
/* Then the attributes. */
while (xptr + 2 <= aDiePtrEnd)
{
+ unsigned int block_len;
unsigned short attr;
/* Parse the attribute based on its form. This section
unsigned short attr;
/* Parse the attribute based on its form. This section
@@
-255,12
+256,24
@@
parse_die (bfd * abfd,
break;
case FORM_BLOCK2:
if (xptr + 2 <= aDiePtrEnd)
break;
case FORM_BLOCK2:
if (xptr + 2 <= aDiePtrEnd)
- xptr += bfd_get_16 (abfd, xptr);
+ {
+ block_len = bfd_get_16 (abfd, xptr);
+ if (xptr + block_len > aDiePtrEnd
+ || xptr + block_len < xptr)
+ return FALSE;
+ xptr += block_len;
+ }
xptr += 2;
break;
case FORM_BLOCK4:
if (xptr + 4 <= aDiePtrEnd)
xptr += 2;
break;
case FORM_BLOCK4:
if (xptr + 4 <= aDiePtrEnd)
- xptr += bfd_get_32 (abfd, xptr);
+ {
+ block_len = bfd_get_32 (abfd, xptr);
+ if (xptr + block_len > aDiePtrEnd
+ || xptr + block_len < xptr)
+ return FALSE;
+ xptr += block_len;
+ }
xptr += 4;
break;
case FORM_STRING:
xptr += 4;
break;
case FORM_STRING:
This page took
0.024591 seconds
and
4
git commands to generate.