-
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
[JS] Embedded JS scripts can have some null chars #15170
Conversation
src/core/core_utils.js
Outdated
code = code && stringToPDFString(code); | ||
code = code.replace(/\u0000+/, ""); |
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.
Given that code
can still be undefined here, this could potentially throw.
Also, don't you need to do a global replacement; hence I'd expect that you actually want the following here:
code = code && stringToPDFString(code); | |
code = code.replace(/\u0000+/, ""); | |
code = code && stringToPDFString(code).replace(/\u0000/g, ""); |
src/core/catalog.js
Outdated
js = stringToPDFString(js); | ||
js = js.replace(/\u0000+/, ""); | ||
javaScript.set(name, js); |
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.
Similar to the other comment:
js = stringToPDFString(js); | |
js = js.replace(/\u0000+/, ""); | |
javaScript.set(name, js); | |
js = stringToPDFString(js).replace(/\u0000/g, ""); | |
javaScript.set(name, js); |
/botio unittest |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.193.163.58:8877/fc98a04d0420faf/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e7ab469820ba6ae/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/e7ab469820ba6ae/output.txt Total script time: 3.06 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/fc98a04d0420faf/output.txt Total script time: 11.38 mins
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/78fa7e96c58689e/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/8534003a45507e6/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/8534003a45507e6/output.txt Total script time: 11.13 mins
|
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.
Unrelated here: It seems that the Windows bot now takes (a lot) longer than before to start building the library and running the tests.
/botio-windows lint |
From: Bot.io (Windows)ReceivedCommand cmd_lint from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/4003f07bddb1250/output.txt |
/botio-windows integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/7f8159dacea0b08/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/7f8159dacea0b08/output.txt Total script time: 7.14 mins
|
It was likely due to some network latency. |
The pdf in https://bugzilla.mozilla.org/show_bug.cgi?id=1779742 contains some scripts with some null chars.
This patch aims to just remove them.