-
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
Add validation for callsubr and callgsubr for type 2 charstrings. #6724
Conversation
Looks like I made #6286 worse, will look into a bit later. |
@brendandahl Nice patch, but it looks like you forgot to add the test in |
subrsIndex = globalSubrIndex; | ||
} | ||
if (!subrsIndex) { | ||
warn('Missing subrsIndex for ' + validationCommand.id); |
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.
This will throw an error if validationCommand === null
, which is what happens with the PDF file from #3117 (comment).
0950535
to
d9cac9c
Compare
I had to add localsubr selection for CID fonts. |
Forgot the test manifest again... |
d9cac9c
to
82be1b9
Compare
/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/5d8d10d92963cb6/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/5d8d10d92963cb6/output.txt Total script time: 0.80 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/9f3b236e39c0970/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/727d62832ea9edc/output.txt |
if (validationCommand.stem) { | ||
hints += stackSize >> 1; | ||
state.stackSize = stackSize; | ||
return this.parseCharString(state, subrsIndex.get(subrNumber), |
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 think we need to continue parsing if this.parseCharString returns true.
Also, we need to track depths of the recursion and reject the charstring if it's too deep.
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/9f3b236e39c0970/output.txt Total script time: 19.17 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/727d62832ea9edc/output.txt Total script time: 19.57 mins
|
CFFFDSelect.prototype = { | ||
getFDIndex: function CFFFDSelect_get(glyphIndex) { | ||
if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { | ||
return false; |
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.
Based on the name of the function, you might expect it to always return an integer, so would it make sense to instead return -1
in this case?
There are some remaining comments above. Could you squash the commits afterwards? |
7d33e16
to
eb7c36b
Compare
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/fa37306ae64fa2f/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/f4ec403abd68f2b/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/fa37306ae64fa2f/output.txt Total script time: 21.14 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/f4ec403abd68f2b/output.txt Total script time: 21.72 mins
|
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/2471204e3332cbe/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/2471204e3332cbe/output.txt Total script time: 0.89 mins Published |
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/25fcfc9ba2ab714/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/565d0c3c7f1d31b/output.txt |
Thank you for the patch |
Add validation for callsubr and callgsubr for type 2 charstrings.
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/25fcfc9ba2ab714/output.txt Total script time: 21.01 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/565d0c3c7f1d31b/output.txt Total script time: 21.12 mins
|
Fixes all the issues in #5929
and Fixes #6565