summaryrefslogtreecommitdiff
path: root/t/comp/parser.t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-12-06 21:27:55 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-12-06 21:27:55 +0000
commit8edd5f42cf54cdbf0218037ce0d38a9e2e2d58d9 (patch)
tree667f471dd4f2cb40fd0bf4d3a45b6927add1d26e /t/comp/parser.t
parenta33bf49bf7b1088ee6ac580e9e39716ad87ae72a (diff)
downloadperl-8edd5f42cf54cdbf0218037ce0d38a9e2e2d58d9.tar.gz
Fix two cases of buffer overflow in the lexer.
p4raw-id: //depot/perl@18251
Diffstat (limited to 't/comp/parser.t')
-rw-r--r--t/comp/parser.t17
1 files changed, 16 insertions, 1 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t
index ab43e7340e..40ae5f18cf 100644
--- a/t/comp/parser.t
+++ b/t/comp/parser.t
@@ -9,7 +9,7 @@ BEGIN {
}
require "./test.pl";
-plan( tests => 10 );
+plan( tests => 12 );
eval '%@x=0;';
like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
@@ -51,3 +51,18 @@ like( $@, qr/error/, 'lexical block discarded by yacc' );
# bug #18573, used to corrupt memory
eval q{ "\c" };
like( $@, qr/^Missing control char name in \\c/, q("\c" string) );
+
+# two tests for memory corruption problems in the said variables
+# (used to dump core or produce strange results)
+
+is( "\Q\Q\Q\Q\Q\Q\Q\Q\Q\Q\Q\Q\Qa", "a", "PL_lex_casestack" );
+
+eval {
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+};
+is( $@, '', 'PL_lex_brackstack' );