diff options
author | Yves Orton <demerphq@gmail.com> | 2023-02-20 04:43:14 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-02-20 16:17:07 +0800 |
commit | bbf836262130e1ab1030c03e3b3b390c28c4bbda (patch) | |
tree | 3c467a5a8c53c87fc1ee3e4e03a0bbcbdcee60e4 /regexec.c | |
parent | 0a73ee9e231197058947bf0a854703757dc357ac (diff) | |
download | perl-bbf836262130e1ab1030c03e3b3b390c28c4bbda.tar.gz |
regexec.c - add assert and test for savestack overflow in Issue #20826.
We have a bug where we can overflow the save-stack. This tests for it
in a TODO test. The next patch will fix it. Note the test will only fail
in debugging as it requires the assert() to be compiled in.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -263,6 +263,7 @@ S_regcppush(pTHX_ const regexp *rex, I32 parenfloor, U32 maxopenparen _pDEPTH) ); SSCHECK(total_elems + REGCP_FRAME_ELEMS); + assert((IV)PL_savestack_max > (IV)(total_elems + REGCP_FRAME_ELEMS)); /* memcpy the offs inside the stack - it's faster than for loop */ memcpy(&PL_savestack[PL_savestack_ix], rex->offs + parenfloor + 1, paren_bytes_to_push); |