-
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 in CFFParser_parseHeader #4473
Conversation
if (offset !== 0) { | ||
} | ||
if (offset === bytesLength) { | ||
return; |
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.
Throw an error, e.g. error('invalid cff header') . also change === to >=
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.
The reason that I didn't throw an error here, is that it prevents most of page 7 from loading. With the current patch, only one particular font will fail to load, but the rest of the page renders fine. The error is caught later in the code anyway, so throwing here seems suboptimal to me.
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.
I don't understand this. By returning undefined you just complicate things later, now you have failure at something like header.endPos
which is less trivial than meaningful message. Not sure why that makes page 7 render.
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.
I don't understand this either any more, since just throwing an error works perfectly now. I don't know what happened previously!
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/9127e5ce977bfce/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/809a562f361d8c1/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/9127e5ce977bfce/output.txt Total script time: 25.86 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/809a562f361d8c1/output.txt Total script time: 36.96 mins
|
Prevent infinite loop in CFFParser_parseHeader
Thank you |
Partial fix for: https://bugzilla.mozilla.org/show_bug.cgi?id=866395.