commit 81cda478974e4198b10054a5ef49bc250c1a3cf7 Author: albert-github Date: Sat May 2 20:24:38 2020 +0200 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. diff --git a/src/scanner.l b/src/scanner.l index 8ceb4adb..e9cad5f8 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; }