[Bug libstdc++/93502] std::regex_match uses stack space proportional to input string length
nyh at math dot technion.ac.il
gcc-bugzilla@gcc.gnu.org
Wed Jan 29 22:33:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93502
--- Comment #2 from Nadav Har'El <nyh at math dot technion.ac.il> ---
Maybe you mean it is a dup of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86164 ?
But I'm not sure. I honestly don't understand the conclusion there that ".*" is
implemented recursively. Why would such a simple case, easily converted to a
deterministic finite automaton with no memory usage at all - need recursion?
Anyway, this is serious bug, which caused a stack overflow and a crash in a
real application. Theoretically such stack overflows can even be exploited by
attackers (although it doesn't look easy).
More information about the Gcc-bugs
mailing list