cp-demangle.c
178 KB
-
Fix a stack exhaustion bug in libiberty's demangler when decoding a… · 6fe6bd7c
Fix a stack exhaustion bug in libiberty's demangler when decoding a pathalogically constructed mangled name. PR 89394 * cp-demangle.c (cplus_demangle_fill_name): Reject negative lengths. (d_count_templates_scopes): Replace num_templates and num_scopes parameters with a struct d_print_info pointer parameter. Adjust body of the function accordingly. Add recursion counter and check that the recursion limit is not reached. (d_print_init): Pass dpi parameter to d_count_templates_scopes. Reset recursion counter afterwards, unless the recursion limit was reached. From-SVN: r270258
Nick Clifton committed