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

fix zipSlip .. regression #2185

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Conversation

jukzi
Copy link
Contributor

@jukzi jukzi commented Mar 20, 2024

@jukzi jukzi force-pushed the zipSlipRegression branch from 5cd0b7d to e26641d Compare March 20, 2024 10:50
@jukzi
Copy link
Contributor Author

jukzi commented Mar 20, 2024

@sratz


public static String getEntryName(String zipfileName, ZipEntry entry) {
String entryName = entry.getName();
if (!java.nio.file.Path.of(zipfileName, entryName).normalize()
Copy link
Contributor

Choose a reason for hiding this comment

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

I was confused at first how Path would be able to handle zip entries, but you're just using the Path API to handle normalization and startsWith() in a semantically correct way (not String.startsWith()).

Neat trick! Looks good

@sratz
Copy link
Contributor

sratz commented Apr 4, 2024

Is this ready to be merged?

@jukzi jukzi merged commit fc75d82 into eclipse-jdt:master Apr 4, 2024
9 checks passed
@jukzi jukzi deleted the zipSlipRegression branch April 4, 2024 15:30
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

Successfully merging this pull request may close these issues.

3 participants