Heap/stack buffer overflow in the dlang_lname function in d-demangle.c in libiberty allows attackers to potentially cause a denial of service (segmentation fault or crash) via a crafted mangled symbol. Example of affected symbols "_D2FGWG44444444444444444EQe", "_D4c?441_Qe_4DmD_i==========UUUqU", "_D33dddQ_D2HHHHDVV_D33dddQDVVHHDQN188Qr" and "_D8ee2_1111Qe". A CVE was already assigned by Red Hat: CVE-2021-3826: libiberty: heap/stack buffer overflow in the dlang_lname function in d-demangle.c
Submitted patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579985.html