From: Todd C. Miller Date: Mon, 6 Jun 2005 23:24:28 +0000 (+0000) Subject: [perl #36193] crash in Perl_yyerror due to missing check for NULL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8bcfe651b09b28d6690b643e50dc59a320126f86;p=p5sagit%2Fp5-mst-13.2.git [perl #36193] crash in Perl_yyerror due to missing check for NULL From: "Todd C. Miller" (via RT) Message-ID: p4raw-id: //depot/perl@24718 --- diff --git a/toke.c b/toke.c index 314ebc7..53adb49 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