Skip to content

Useless assignment to local variable in the src/core/xfa/template.js file #13835

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

Closed
Snuffleupagus opened this issue Aug 1, 2021 · 1 comment · Fixed by #13847
Closed

Useless assignment to local variable in the src/core/xfa/template.js file #13835

Snuffleupagus opened this issue Aug 1, 2021 · 1 comment · Fixed by #13847
Assignees
Labels

Comments

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Aug 1, 2021

The following code is flagged as dead (since it's replacing rather than updating the existing Object):

availableSpace = {
width: this.w === "" ? availableSpace.width : this.w,
height: this.h === "" ? availableSpace.height : this.h,
};

according to the alert in https://github.com/mozilla/pdf.js/security/code-scanning/103?query=ref%3Arefs%2Fheads%2Fmaster

Looking at the surrounding code, I can see a couple of possibilities here:

  1. This is indeed just dead code, which should be removed.
  2. The code should be moved up, and placed just above the previous block instead.
  3. There should be other, more invasive, changes made to this code...

/cc @calixteman Which solution is correct here?
Assuming it's either option 1 or 2, I can submit a patch to fix this.

@calixteman
Copy link
Contributor

It's dead code.

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