Skip to content

Problem with relative targetPath in 0.4.8 #214

@ajssd

Description

@ajssd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions