The demangle_template function in cplus-dem.c in GNU libiberty as distributed in GNU Binutils 2.31.1 has a memory leak via a crafted string leading to a denial of service (memory consumption) as demonstrated by cxxfilt a related issue to CVE-2018-12698.