From 81cda478974e4198b10054a5ef49bc250c1a3cf7 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 2 May 2020 20:24:38 +0200 Subject: Input buffer overflow in php input code (#7745) When having a very long initialization line in php code we get the message: ``` input buffer overflow, can't enlarge buffer because scanner uses REJECT ``` In this case the, easy, solution is to split, in the lexer, the input based on the commas. --- src/scanner.l | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scanner.l b/src/scanner.l index 8ceb4ad..e9cad5f 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2898,7 +2898,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) *yyextra->pCopyRoundString+=yytext; } } -[^"'()\n]+ { +[^"'()\n,]+ { *yyextra->pCopyRoundString+=yytext; } . { @@ -2948,7 +2948,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) *yyextra->pCopyRoundGString+=yytext; } } -[^"'()\n/]+ { +[^"'()\n\/,]+ { *yyextra->pCopyRoundGString+=yytext; } . { @@ -2998,7 +2998,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) *yyextra->pCopySquareGString+=yytext; } } -[^"\[\]\n/]+ { +[^"\[\]\n\/,]+ { *yyextra->pCopySquareGString+=yytext; } . { @@ -3039,7 +3039,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) *yyextra->pCopyCurlyString+=yytext; } } -[^"'{}\/\n]+ { +[^"'{}\/\n,]+ { *yyextra->pCopyCurlyString+=yytext; } "/" { *yyextra->pCopyCurlyString+=yytext; } -- cgit v0.12