summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorSam Tregar <sam@tregar.com>2001-12-30 14:57:55 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-31 04:05:46 +0000
commit2f758a169336880aced9e22abce6d9196c383e06 (patch)
tree7a2489ca4726146a64445ca6f5b359f65ee0f535 /toke.c
parent443a5b981950c0a4ba09217be56a57cb04e64247 (diff)
downloadperl-2f758a169336880aced9e22abce6d9196c383e06.tar.gz
Basic bad prototype detection
Message-ID: <Pine.LNX.4.33.0112301948270.9102-200000@localhost.localdomain> p4raw-id: //depot/perl@13971
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index 1527daaff2..55aaedbea1 100644
--- a/toke.c
+++ b/toke.c
@@ -4952,10 +4952,13 @@ Perl_yylex(pTHX)
s = scan_str(s,FALSE,FALSE);
if (!s)
Perl_croak(aTHX_ "Prototype not terminated");
- /* strip spaces */
+ /* strip spaces and check for bad characters */
d = SvPVX(PL_lex_stuff);
tmp = 0;
for (p = d; *p; ++p) {
+ if (!strchr("$@%*;[]&\\ ", *p))
+ Perl_croak(aTHX_ "Malformed prototype for %s : %s",
+ SvPVX(PL_subname), d);
if (!isSPACE(*p))
d[tmp++] = *p;
}