summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-08-16 13:50:46 +0100
committerDavid Mitchell <davem@iabyn.com>2016-08-16 13:50:46 +0100
commite487ff5ee8f0cde894977f61d319c0c4e44aa0bd (patch)
tree747b7a2c7961568a9de8a688aaff1cd221d1acd8 /t/comp
parent27368b5c886989ee5e8113e4fc4c6ce538205bb6 (diff)
downloadperl-e487ff5ee8f0cde894977f61d319c0c4e44aa0bd.tar.gz
buffer overflow in "string terminator" err msg
RT #128952 In eval "q" . chr(100000000064); generating the error message C<Can't find string terminator "XXX"'> was overrunning a buffer designed to hold a single utf8 char, since it wasn't allowing for the \0 at the end.
Diffstat (limited to 't/comp')
-rw-r--r--t/comp/parser.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t
index ebfcb9d613..5ca07eaf4d 100644
--- a/t/comp/parser.t
+++ b/t/comp/parser.t
@@ -8,7 +8,7 @@ BEGIN {
chdir 't' if -d 't';
}
-print "1..185\n";
+print "1..186\n";
sub failed {
my ($got, $expected, $name) = @_;
@@ -573,6 +573,15 @@ is $@, "", 'read into keys';
eval 'substr keys(%h),0,=3';
is $@, "", 'substr keys assignment';
+# very large utf8 char in error message was overflowing buffer
+{
+
+ no warnings;
+ eval "q" . chr(100000000064);
+ like $@, qr/Can't find string terminator "." anywhere before EOF/,
+ 'RT 128952';
+}
+
# Add new tests HERE (above this line)
# bug #74022: Loop on characters in \p{OtherIDContinue}