aboutsummaryrefslogtreecommitdiff
path: root/libiberty/ChangeLog
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2017-04-21 09:02:03 +0000
committerMark Wielaard <mark@gcc.gnu.org>2017-04-21 09:02:03 +0000
commit6b086d35b79425de90a09c8bd843170a038fbde8 (patch)
tree8229f4b0678829d2f4ee36ac3f394bc4b2c195cb /libiberty/ChangeLog
parent13b6ef76dc275232310ebfca27db08aeef9b858c (diff)
downloadgcc-6b086d35b79425de90a09c8bd843170a038fbde8.zip
gcc-6b086d35b79425de90a09c8bd843170a038fbde8.tar.gz
gcc-6b086d35b79425de90a09c8bd843170a038fbde8.tar.bz2
libiberty: Limit demangler maximum d_print_comp recursion call depth.
The fix for PR demangler/70909 and 67264 (endless demangler recursion) catches when a demangle_component is printed in a cycle. But that doesn't protect the call stack blowing up from non-cyclic nested types printed recursively through d_print_comp. This can happen by a (very) long mangled string that simply creates a very deep pointer or qualifier chain. Limit the recursive d_print_comp call depth for a d_print_info to 1K nested types. libiberty/ChangeLog: * cp-demangle.c (MAX_RECURSION_COUNT): New constant. (struct d_print_info): Add recursion field. (d_print_init): Initialize recursion. (d_print_comp): Check and update d_print_info recursion depth. From-SVN: r247056
Diffstat (limited to 'libiberty/ChangeLog')
-rw-r--r--libiberty/ChangeLog7
1 files changed, 7 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 673eb26..34e585e 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,5 +1,12 @@
2017-04-21 Mark Wielaard <mark@klomp.org>
+ * cp-demangle.c (MAX_RECURSION_COUNT): New constant.
+ (struct d_print_info): Add recursion field.
+ (d_print_init): Initialize recursion.
+ (d_print_comp): Check and update d_print_info recursion depth.
+
+2017-04-21 Mark Wielaard <mark@klomp.org>
+
* cp-demangle.c (d_substitution): Return NULL if d_add_substitution
fails.