Skip to content

Commit

Permalink
fix zipSlip
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T authored and gayanper committed Sep 7, 2024
1 parent 3f0e748 commit b695e79
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ protected boolean computeChildren(OpenableElementInfo info, IResource underlying
for (Enumeration<? extends ZipEntry> e= jar.entries(); e.hasMoreElements();) {
ZipEntry member= e.nextElement();
String name = member.getName();
if (name.contains("..")) { //$NON-NLS-1$
throw new IllegalArgumentException("Bad zip entry: "+name+" in "+jar.getName()); //$NON-NLS-1$ //$NON-NLS-2$
}
if (this.multiVersion && name.length() > (length + 2) && name.startsWith(version)) {
int end = name.indexOf('/', length);
if (end >= name.length()) continue;
Expand Down

0 comments on commit b695e79

Please sign in to comment.