Fix path problem in NpmPackage
This commit is contained in:
parent
4eff9a3b68
commit
774440d0a7
|
@ -462,7 +462,7 @@ public class NpmPackage {
|
||||||
|
|
||||||
while ((entry = (TarArchiveEntry) tarIn.getNextEntry()) != null) {
|
while ((entry = (TarArchiveEntry) tarIn.getNextEntry()) != null) {
|
||||||
String n = entry.getName();
|
String n = entry.getName();
|
||||||
if (n.contains("..")) {
|
if (n.contains("/..") || n.contains("../")) {
|
||||||
throw new RuntimeException("Entry with an illegal name: " + n);
|
throw new RuntimeException("Entry with an illegal name: " + n);
|
||||||
}
|
}
|
||||||
if (entry.isDirectory()) {
|
if (entry.isDirectory()) {
|
||||||
|
|
Loading…
Reference in New Issue