Skip to content

Problem with relative targetPath in 0.4.8 #214

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
ajssd opened this issue Apr 23, 2018 · 1 comment
Closed

Problem with relative targetPath in 0.4.8 #214

ajssd opened this issue Apr 23, 2018 · 1 comment

Comments

@ajssd
Copy link

ajssd commented Apr 23, 2018

Extracting to a relative directory worked in 0.4.7, but now in 0.4.8 it causes an error.

var zip = new AdmZip("../lib/" + fileName);
zip.extractAllTo("../lib/" + dirName, true);

Looks like the code throwing the error is

if (!pth.resolve(targetPath, entryName).startsWith(targetPath)) {
  throw Utils.Errors.INVALID_FILENAME + ": " + entryName;
}

What's happening is that pth.resolve() is returning a /full/path/to/the/entry, but it does not start with 'targetPath' since 'targetPath' is relative as shown above.

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

No branches or pull requests

3 participants