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

Add more validation to PDFLinkService_navigateTo #7750

Merged
merged 2 commits into from
Oct 27, 2016
Merged

Add more validation to PDFLinkService_navigateTo #7750

merged 2 commits into from
Oct 27, 2016

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Oct 24, 2016

Please refer to the individual commit messages.


This change is Reviewable

In some PDF files, the first element (i.e. the one containing either a `Ref` or a `Number` pointing to a page) of the explicit destination Array may be bogus.

One such example is actually the file `pdf.pdf` in the test-suite, where some destinations are incompletely specified. One such example being the `G1.998360` destination whose explicit destination Array contains `[null, /XYZ, 54, 488, null]`, i.e. the destination page is `null`.
Hence this patch adds a bit more validation for that case. It also adds an additional check to ensure that the resulting `pageNumber` is non-negative, and finally a couple more error messages for existing cases of malformed data.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/1b098105cdb98b5/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/1b098105cdb98b5/output.txt

Total script time: 1.91 mins

Published

@timvandermeij
Copy link
Contributor

timvandermeij commented Oct 27, 2016

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 1

Live output at: http://107.21.233.14:8877/37bd68fdd1a6cd9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 1

Live output at: http://107.22.172.223:8877/88d278f5bb923af/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/88d278f5bb923af/output.txt

Total script time: 25.70 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/37bd68fdd1a6cd9/output.txt

Total script time: 37.81 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@timvandermeij timvandermeij merged commit abc417c into mozilla:master Oct 27, 2016
@timvandermeij
Copy link
Contributor

Thank you for the patch!

@Snuffleupagus Snuffleupagus deleted the PDFLinkService_navigateTo-more-validation branch October 27, 2016 20:20
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
…igateTo-more-validation

Add more validation to `PDFLinkService_navigateTo`
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