summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@courtesan.com>2005-06-06 23:24:28 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-06-07 08:56:37 +0000
commit8bcfe651b09b28d6690b643e50dc59a320126f86 (patch)
tree7aed580523c8d40e176c8fb0ee86923065182c9a /toke.c
parent862a34c634844bb3ea22e5f44bdaf2e973831a89 (diff)
downloadperl-8bcfe651b09b28d6690b643e50dc59a320126f86.tar.gz
[perl #36193] crash in Perl_yyerror due to missing check for NULL
From: "Todd C. Miller" (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.0.11-36193-115243.12.1531563965146@perl.org> p4raw-id: //depot/perl@24718
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index 314ebc713b..53adb49522 100644
--- a/toke.c
+++ b/toke.c
@@ -10674,8 +10674,9 @@ Perl_yyerror(pTHX_ const char *s)
if (!yychar || (yychar == ';' && !PL_rsfp))
where = "at EOF";
- else if (PL_bufptr > PL_oldoldbufptr && PL_bufptr - PL_oldoldbufptr < 200 &&
- PL_oldoldbufptr != PL_oldbufptr && PL_oldbufptr != PL_bufptr) {
+ else if (PL_oldoldbufptr && PL_bufptr > PL_oldoldbufptr &&
+ PL_bufptr - PL_oldoldbufptr < 200 && PL_oldoldbufptr != PL_oldbufptr &&
+ PL_oldbufptr != PL_bufptr) {
/*
Only for NetWare:
The code below is removed for NetWare because it abends/crashes on NetWare
@@ -10690,8 +10691,8 @@ Perl_yyerror(pTHX_ const char *s)
context = PL_oldoldbufptr;
contlen = PL_bufptr - PL_oldoldbufptr;
}
- else if (PL_bufptr > PL_oldbufptr && PL_bufptr - PL_oldbufptr < 200 &&
- PL_oldbufptr != PL_bufptr) {
+ else if (PL_oldbufptr && PL_bufptr > PL_oldbufptr &&
+ PL_bufptr - PL_oldbufptr < 200 && PL_oldbufptr != PL_bufptr) {
/*
Only for NetWare:
The code below is removed for NetWare because it abends/crashes on NetWare