From 8bcfe651b09b28d6690b643e50dc59a320126f86 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 6 Jun 2005 23:24:28 +0000 Subject: [PATCH] [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 --- toke.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 -- 2.7.4