Skip to content

Commit 0aa2496

Browse files
authored
Merge pull request doxygen#11628 from albert-github/feature/bug_php_reject
Input buffer overflow
2 parents a8479a7 + f519f8f commit 0aa2496

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/code.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,10 +1279,10 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
12791279
yyextra->inForEachExpression = FALSE;
12801280
BEGIN( SkipStringS );
12811281
}
1282-
<SkipString>[^\"\\\r\n]* {
1282+
<SkipString>[^\"\\\r\n]{1,100} {
12831283
yyextra->code->codify(yytext);
12841284
}
1285-
<SkipStringS>[^\'\\\r\n]* {
1285+
<SkipStringS>[^\'\\\r\n]{1,100} {
12861286
yyextra->code->codify(yytext);
12871287
}
12881288
<SkipString,SkipStringS>{CPPC}|{CCS} {

src/pre.l

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,10 @@ WSopt [ \t\r]*
607607
outputChar(yyscanner,*yytext);
608608
BEGIN( CopyStringFtn );
609609
}
610-
<CopyString>[^\"\\\r\n]+ {
610+
<CopyString>[^\"\\\r\n]{1,1000} {
611611
outputArray(yyscanner,yytext,yyleng);
612612
}
613-
<CopyStringCs>[^\"\r\n]+ {
613+
<CopyStringCs>[^\"\r\n]{1,1000} {
614614
outputArray(yyscanner,yytext,yyleng);
615615
}
616616
<CopyStringCs>\"\" {
@@ -623,7 +623,7 @@ WSopt [ \t\r]*
623623
outputChar(yyscanner,*yytext);
624624
BEGIN( CopyLine );
625625
}
626-
<CopyStringFtnDouble>[^\"\\\r\n]+ {
626+
<CopyStringFtnDouble>[^\"\\\r\n]{1,1000} {
627627
outputArray(yyscanner,yytext,yyleng);
628628
}
629629
<CopyStringFtnDouble>\\. {
@@ -633,7 +633,7 @@ WSopt [ \t\r]*
633633
outputChar(yyscanner,*yytext);
634634
BEGIN( CopyLine );
635635
}
636-
<CopyStringFtn>[^\'\\\r\n]+ {
636+
<CopyStringFtn>[^\'\\\r\n]{1,1000} {
637637
outputArray(yyscanner,yytext,yyleng);
638638
}
639639
<CopyStringFtn>\\. {
@@ -652,7 +652,7 @@ WSopt [ \t\r]*
652652
BEGIN( CopyLine );
653653
}
654654
}
655-
<CopyRawString>[^)]+ {
655+
<CopyRawString>[^)]{1,1000} {
656656
outputArray(yyscanner,yytext,yyleng);
657657
}
658658
<CopyRawString>. {

src/scanner.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5141,7 +5141,7 @@ NONLopt [^\n]*
51415141
if (yyextra->insidePHP)
51425142
{
51435143
yyextra->lastCopyArgStringContext=YY_START;
5144-
BEGIN(CopyArgPHPString);
5144+
BEGIN(SkipPHPString);
51455145
}
51465146
}
51475147
<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSquare,CopyArgSharp>"<="|">="|"<=>" {

0 commit comments

Comments
 (0)