-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent infinite loop when scanning for endstream (bug 1020226) #4902
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/1afa9821b6c1ac4/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/1afa9821b6c1ac4/output.txt Total script time: 0.73 mins Published
|
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/fb6023affb100d8/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/2a81f514cca68b3/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/fb6023affb100d8/output.txt Total script time: 23.20 mins
Image differences available at: http://107.22.172.223:8877/fb6023affb100d8/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/2a81f514cca68b3/output.txt Total script time: 26.15 mins
|
@@ -266,6 +266,9 @@ var Parser = (function ParserClosure() { | |||
while (stream.pos < stream.end) { | |||
var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE); | |||
var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH; | |||
if (scanLength === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use scanLength <= 0
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/c1028edb07ee000/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/308397cc8106769/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/308397cc8106769/output.txt Total script time: 21.19 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/c1028edb07ee000/output.txt Total script time: 26.09 mins
|
Prevent infinite loop when scanning for endstream (bug 1020226)
Thank you |
Note: even with this patch, the file referenced in the bug still doesn't load in PDF.js. However I think this is OK, since even Adobe Reader won't open the file (it just displays a message saying that the file is damaged).