Actions
Bug #20453
closedPointer being freed was not allocated in Regexp timeout
Description
https://bugs.ruby-lang.org/issues/20228 frees stk_base
to avoid a memory leak, but stk_base
is sometimes stack allocated (see xalloca
). So the free only works if the regex stack grows enough that it needs to double (see xmalloc
and xrealloc
in stack_double
.
Reproduction:
Regexp.timeout = 0.001
/^(a*)x$/ =~ "a" * 1000000 + "x"'
I'll open a PR shortly.
https://bugs.ruby-lang.org/issues/20228 was backported to 3.3.1, so this bug affects that version as well.
Actions
Like1
Like0Like0Like0Like0Like0