This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #36193] crash in Perl_yyerror due to missing check for NULL
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 6 Jun 2005 23:24:28 +0000 (23:24 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 7 Jun 2005 08:56:37 +0000 (08:56 +0000)
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

toke.c

diff --git a/toke.c b/toke.c
index 314ebc7..53adb49 100644 (file)
--- 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