summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-10-17 14:32:41 +1100
committerTony Cook <tony@develop-help.com>2016-10-17 14:32:41 +1100
commit4eadd82f8c152034818f42956737102f674f9118 (patch)
treec52acfc746cd735369880a77d18ad39d2b6a08b8 /t
parent87af8d55d30dca849a4094c502ad2d067745049f (diff)
downloadperl-4eadd82f8c152034818f42956737102f674f9118.tar.gz
(perl #128996) prevent PL_op pointing to freed ops
When yylex() attempts to report a UTF-8 encoding error, it indirectly accesses PL_op, this would cause an access to freed memory if the CV containing that op (and the op itself) had been freed.
Diffstat (limited to 't')
-rw-r--r--t/op/lex.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/lex.t b/t/op/lex.t
index 9696669574..db0cf3acfb 100644
--- a/t/op/lex.t
+++ b/t/op/lex.t
@@ -7,7 +7,7 @@ use warnings;
BEGIN { chdir 't' if -d 't'; require './test.pl'; }
-plan(tests => 31);
+plan(tests => 32);
{
no warnings 'deprecated';
@@ -248,3 +248,10 @@ fresh_perl_like(
{},
'[perl #129336] - #!perl -i argument handling'
);
+fresh_perl_is(
+ "BEGIN{\$^H=hex ~0}\xF3",
+ "Integer overflow in hexadecimal number at - line 1.\n" .
+ "Malformed UTF-8 character: \\xf3 (too short; got 1 byte, need 4) at - line 1.",
+ {},
+ '[perl #128996] - use of PL_op after op is freed'
+);