diff options
author | Alexey Neyman <stilor@att.net> | 2017-12-02 12:44:39 -0800 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-12-02 12:44:39 -0800 |
commit | 98bc4decdeab1361bdc585c86591718fb08c8ffb (patch) | |
tree | 4e048ed57988306696efa3c5b81a80d48030e913 /packages/gdb/6.8a/0000-dwarf-stack-overflow.patch | |
parent | 2a1935f3ad41d360dd3d96a1b0486083293651dd (diff) | |
download | crosstool-ng-98bc4decdeab1361bdc585c86591718fb08c8ffb.tar.gz crosstool-ng-98bc4decdeab1361bdc585c86591718fb08c8ffb.tar.bz2 crosstool-ng-98bc4decdeab1361bdc585c86591718fb08c8ffb.zip |
Run all patches through renumbering and update
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'packages/gdb/6.8a/0000-dwarf-stack-overflow.patch')
-rw-r--r-- | packages/gdb/6.8a/0000-dwarf-stack-overflow.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/packages/gdb/6.8a/0000-dwarf-stack-overflow.patch b/packages/gdb/6.8a/0000-dwarf-stack-overflow.patch new file mode 100644 index 00000000..b409c5be --- /dev/null +++ b/packages/gdb/6.8a/0000-dwarf-stack-overflow.patch @@ -0,0 +1,55 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/80_all_gdb-6.5-dwarf-stack-overflow.patch +-= BEGIN original header =- +http://bugs.gentoo.org/144833 + +for gdb/ChangeLog: +2006-08-22 Will Drewry <wad@google.com> + Tavis Ormandy <taviso@google.com> + + * dwarf2read.c (decode_locdesc): Enforce location description stack + boundaries. + * dwarfread.c (locval): Likewise. + +-= END original header =- +--- + gdb/dwarf2read.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -9124,8 +9124,7 @@ + callers will only want a very basic result and this can become a + complaint. + +- Note that stack[0] is unused except as a default error return. +- Note that stack overflow is not yet handled. */ ++ Note that stack[0] is unused except as a default error return. */ + + static CORE_ADDR + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) +@@ -9142,7 +9141,7 @@ + + i = 0; + stacki = 0; +- stack[stacki] = 0; ++ stack[++stacki] = 0; + + while (i < size) + { +@@ -9324,6 +9323,16 @@ + dwarf_stack_op_name (op)); + return (stack[stacki]); + } ++ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing ++ outside of the allocated space. Also enforce minimum > 0. ++ -- wad@google.com 14 Aug 2006 */ ++ if (stacki >= sizeof (stack) / sizeof (*stack) - 1) ++ internal_error (__FILE__, __LINE__, ++ _("location description stack too deep: %d"), ++ stacki); ++ if (stacki <= 0) ++ internal_error (__FILE__, __LINE__, ++ _("location description stack too shallow")); + } + return (stack[stacki]); + } |