diff options
author | Yves Orton <demerphq@gmail.com> | 2016-03-06 13:56:44 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2016-03-06 14:06:08 +0100 |
commit | ba6840fbf2fdde3e7f1bda1a26f46c901f36d5ec (patch) | |
tree | b13ed1fefd5dc5bdf2c79711f41cbb320bced2dd /regcomp.h | |
parent | d5a00e4af6b155495be31a35728b8fef8e671ebe (diff) | |
download | perl-ba6840fbf2fdde3e7f1bda1a26f46c901f36d5ec.tar.gz |
fix Perl #126182, out of memory due to infinite pattern recursion
The way we tracked if pattern recursion was infinite did not work
properly. A pattern like
"a"=~/(.(?2))((?<=(?=(?1)).))/
would loop forever, slowly eat up all available ram as it added
pattern recursion stack frames.
This patch changes the rules for recursion so that recursively
entering a given pattern "subroutine" twice from the same position
fails the match. This means that where previously we might have
seen fatal exception we will now simply fail. This means that
"aaabbb"=~/a(?R)?b/
succeeds with $& equal to "aaabbb".
Diffstat (limited to 'regcomp.h')
-rw-r--r-- | regcomp.h | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -90,8 +90,6 @@ /* This is the stuff that used to live in regexp.h that was truly private to the engine itself. It now lives here. */ - - typedef struct regexp_internal { int name_list_idx; /* Optional data index of an array of paren names */ union { |