|
Than Ngo |
39bce8 |
commit 81cda478974e4198b10054a5ef49bc250c1a3cf7
|
|
Than Ngo |
39bce8 |
Author: albert-github <albert.tests@gmail.com>
|
|
Than Ngo |
39bce8 |
Date: Sat May 2 20:24:38 2020 +0200
|
|
Than Ngo |
39bce8 |
|
|
Than Ngo |
39bce8 |
Input buffer overflow in php input code (#7745)
|
|
Than Ngo |
39bce8 |
|
|
Than Ngo |
39bce8 |
When having a very long initialization line in php code we get the message:
|
|
Than Ngo |
39bce8 |
```
|
|
Than Ngo |
39bce8 |
input buffer overflow, can't enlarge buffer because scanner uses REJECT
|
|
Than Ngo |
39bce8 |
```
|
|
Than Ngo |
39bce8 |
|
|
Than Ngo |
39bce8 |
In this case the, easy, solution is to split, in the lexer, the input based on the commas.
|
|
Than Ngo |
39bce8 |
|
|
Than Ngo |
39bce8 |
diff --git a/src/scanner.l b/src/scanner.l
|
|
Than Ngo |
39bce8 |
index 8ceb4adb..e9cad5f8 100644
|
|
Than Ngo |
39bce8 |
--- a/src/scanner.l
|
|
Than Ngo |
39bce8 |
+++ b/src/scanner.l
|
|
Than Ngo |
39bce8 |
@@ -2898,7 +2898,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
|
|
Than Ngo |
39bce8 |
*yyextra->pCopyRoundString+=yytext;
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
-<CopyRound>[^"'()\n]+ {
|
|
Than Ngo |
39bce8 |
+<CopyRound>[^"'()\n,]+ {
|
|
Than Ngo |
39bce8 |
*yyextra->pCopyRoundString+=yytext;
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
<CopyRound>. {
|
|
Than Ngo |
39bce8 |
@@ -2948,7 +2948,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
|
|
Than Ngo |
39bce8 |
*yyextra->pCopyRoundGString+=yytext;
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
-<GCopyRound>[^"'()\n/]+ {
|
|
Than Ngo |
39bce8 |
+<GCopyRound>[^"'()\n\/,]+ {
|
|
Than Ngo |
39bce8 |
*yyextra->pCopyRoundGString+=yytext;
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
<GCopyRound>. {
|
|
Than Ngo |
39bce8 |
@@ -2998,7 +2998,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
|
|
Than Ngo |
39bce8 |
*yyextra->pCopySquareGString+=yytext;
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
-<GCopySquare>[^"\[\]\n/]+ {
|
|
Than Ngo |
39bce8 |
+<GCopySquare>[^"\[\]\n\/,]+ {
|
|
Than Ngo |
39bce8 |
*yyextra->pCopySquareGString+=yytext;
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
<GCopySquare>. {
|
|
Than Ngo |
39bce8 |
@@ -3039,7 +3039,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
|
|
Than Ngo |
39bce8 |
*yyextra->pCopyCurlyString+=yytext;
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
-<CopyCurly>[^"'{}\/\n]+ {
|
|
Than Ngo |
39bce8 |
+<CopyCurly>[^"'{}\/\n,]+ {
|
|
Than Ngo |
39bce8 |
*yyextra->pCopyCurlyString+=yytext;
|
|
Than Ngo |
39bce8 |
}
|
|
Than Ngo |
39bce8 |
<CopyCurly>"/" { *yyextra->pCopyCurlyString+=yytext; }
|