Skip to content
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

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

calixteman
Copy link
Contributor

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.

Comment on lines 342 to 343
code = code && stringToPDFString(code);
code = code.replace(/\u0000+/, "");
Copy link
Collaborator

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:

Suggested change
code = code && stringToPDFString(code);
code = code.replace(/\u0000+/, "");
code = code && stringToPDFString(code).replace(/\u0000/g, "");

Comment on lines 985 to 986
js = stringToPDFString(js);
js = js.replace(/\u0000+/, "");
javaScript.set(name, js);
Copy link
Collaborator

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:

Suggested change
js = stringToPDFString(js);
js = js.replace(/\u0000+/, "");
javaScript.set(name, js);
js = stringToPDFString(js).replace(/\u0000/g, "");
javaScript.set(name, js);

@Snuffleupagus
Copy link
Collaborator

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.193.163.58:8877/fc98a04d0420faf/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/e7ab469820ba6ae/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/e7ab469820ba6ae/output.txt

Total script time: 3.06 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/fc98a04d0420faf/output.txt

Total script time: 11.38 mins

  • Unit Tests: Passed

@Snuffleupagus
Copy link
Collaborator

/botio integrationtest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/78fa7e96c58689e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/8534003a45507e6/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/8534003a45507e6/output.txt

Total script time: 11.13 mins

  • Integration Tests: FAILED

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a 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.

@Snuffleupagus Snuffleupagus merged commit de7d1d2 into mozilla:master Jul 15, 2022
@calixteman
Copy link
Contributor Author

/botio-windows lint

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_lint from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/4003f07bddb1250/output.txt

@calixteman
Copy link
Contributor Author

/botio-windows integrationtest

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/7f8159dacea0b08/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/7f8159dacea0b08/output.txt

Total script time: 7.14 mins

  • Integration Tests: FAILED

@calixteman
Copy link
Contributor Author

It was likely due to some network latency.
If I compare my last try with this one:
#15147 (comment)
I think we're good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants