Merge pull request #8063 from Snuffleupagus/issue-8061
Consume the current character when encountering illegal characters in `Lexer.getObject`, in order to prevent infinite loops during reading of streams (issue 8061)
This commit is contained in:
commit
41041c1576
@ -1013,6 +1013,11 @@ var Lexer = (function LexerClosure() {
|
|||||||
this.nextChar();
|
this.nextChar();
|
||||||
return Cmd.get('}');
|
return Cmd.get('}');
|
||||||
case 0x29: // ')'
|
case 0x29: // ')'
|
||||||
|
// Consume the current character in order to avoid permanently hanging
|
||||||
|
// the worker thread if `Lexer.getObject` is called from within a loop
|
||||||
|
// containing try-catch statements, since we would otherwise attempt
|
||||||
|
// to parse the *same* character over and over (fixes issue8061.pdf).
|
||||||
|
this.nextChar();
|
||||||
error('Illegal character: ' + ch);
|
error('Illegal character: ' + ch);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -45,6 +45,7 @@
|
|||||||
!issue7855.pdf
|
!issue7855.pdf
|
||||||
!issue7872.pdf
|
!issue7872.pdf
|
||||||
!issue7901.pdf
|
!issue7901.pdf
|
||||||
|
!issue8061.pdf
|
||||||
!bad-PageLabels.pdf
|
!bad-PageLabels.pdf
|
||||||
!filled-background.pdf
|
!filled-background.pdf
|
||||||
!ArabicCIDTrueType.pdf
|
!ArabicCIDTrueType.pdf
|
||||||
|
BIN
test/pdfs/issue8061.pdf
Normal file
BIN
test/pdfs/issue8061.pdf
Normal file
Binary file not shown.
@ -1712,6 +1712,13 @@
|
|||||||
"link": false,
|
"link": false,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue8061",
|
||||||
|
"file": "pdfs/issue8061.pdf",
|
||||||
|
"md5": "d61fe1dcdcd55bca00b351b2fc2c6dc7",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": false,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue7580-eq",
|
{ "id": "issue7580-eq",
|
||||||
"file": "pdfs/issue7580.pdf",
|
"file": "pdfs/issue7580.pdf",
|
||||||
"md5": "44dd5a9b4373fcab9890cf567722a766",
|
"md5": "44dd5a9b4373fcab9890cf567722a766",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user