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

XFA - Prevent breaking errors in Binder, when searchNode doesn't return data (issue 13756) #13761

Merged
merged 1 commit into from
Jul 19, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

As can be seen in the code (see below), the searchNode helper function will return null in some cases and all of its call-sites should protect against that before attempting to access the returned data.
While only one of these changes were necessary to fix the breaking errors in issue #13756, in order to prevent future bugs I've added similar defensive code throughout this file.

…return data (issue 13756)

As can be seen in the code (see below), the `searchNode` helper function will return `null` in some cases and all of its call-sites should protect against that before attempting to access the returned data.
While only one of these changes were necessary to fix the breaking errors in issue 13756, in order to prevent future bugs I've added similar defensive code throughout this file.

 - https://github.com/mozilla/pdf.js/blob/07955fa1d31df62fd668a15f58cd40b29a82bd63/src/core/xfa/som.js#L169
 - https://github.com/mozilla/pdf.js/blob/07955fa1d31df62fd668a15f58cd40b29a82bd63/src/core/xfa/som.js#L239
 - https://github.com/mozilla/pdf.js/blob/07955fa1d31df62fd668a15f58cd40b29a82bd63/src/core/xfa/som.js#L254
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks for doing that.

@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/543dc83afa2916b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/b7d0a36805c437f/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/543dc83afa2916b/output.txt

Total script time: 32.55 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 7
  different first/second rendering: 1

Image differences available at: http://54.67.70.0:8877/543dc83afa2916b/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/b7d0a36805c437f/output.txt

Total script time: 37.91 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 6
  different first/second rendering: 1

Image differences available at: http://3.101.106.178:8877/b7d0a36805c437f/reftest-analyzer.html#web=eq.log

@Snuffleupagus Snuffleupagus merged commit 683ce66 into mozilla:master Jul 19, 2021
@Snuffleupagus
Copy link
Collaborator Author

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/ce1b51af21ad9ae/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/b7f072715331748/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/ce1b51af21ad9ae/output.txt

Total script time: 29.33 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/b7f072715331748/output.txt

Total script time: 35.46 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@Snuffleupagus Snuffleupagus deleted the issue-13756 branch July 19, 2021 18:21
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