summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2017-02-01 14:34:16 +1100
committerTony Cook <tony@develop-help.com>2017-02-01 14:34:16 +1100
commitdc0dad9b91adb09c774c7248bc91a44b7a777d4d (patch)
treea8c34ae1ca82a8db8daa5d93b43ae0071f11b68d /t
parent6b9660cae39cc0ce59738753e42153cb3be530c7 (diff)
downloadperl-dc0dad9b91adb09c774c7248bc91a44b7a777d4d.tar.gz
(perl #130684) allocate enough space for the extra 'x'
77c8f26370dcc0e added support for a doubled x regexp flags, and ensured the doubled flag was passed to the qr// created by S_compile_runtime_code(). Unfortunately it didn't ensure enough space was allocated for that extra 'x'.
Diffstat (limited to 't')
-rw-r--r--t/re/pat.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/re/pat.t b/t/re/pat.t
index d5e5d2fd4a..9abe5aa119 100644
--- a/t/re/pat.t
+++ b/t/re/pat.t
@@ -23,7 +23,7 @@ BEGIN {
skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader;
skip_all_without_unicode_tables();
-plan tests => 835; # Update this when adding/deleting tests.
+plan tests => 836; # Update this when adding/deleting tests.
run_tests() unless caller;
@@ -1901,6 +1901,12 @@ EOP
}msx, { stderr => 1 }, "Offsets in debug output are not negative");
}
}
+ {
+ # buffer overflow
+ fresh_perl_is("BEGIN{\$^H=0x200000}\ns/[(?{//xx",
+ "Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE (?{/ at (eval 1) line 1.\n",
+ {}, "buffer overflow for regexp component");
+ }
} # End of sub run_tests
1;