Browse Source

TarEntry.java was validating the maximum length for filenames only in one

place. The tar-task used another constructor. Simply copied the verification
to the other constructor to do the check there also. Now throws a
RuntimeException.

Submitted By: "Nico Seessle" <Nico.Seessle@epost.de>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268494 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
1c59975f51
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/main/org/apache/tools/tar/TarEntry.java

+ 6
- 0
src/main/org/apache/tools/tar/TarEntry.java View File

@@ -177,6 +177,12 @@ public class TarEntry implements TarConstants {
this.groupName = new StringBuffer("");
this.devMajor = 0;
this.devMinor = 0;

if (this.name.length() > NAMELEN) {
throw new RuntimeException("file name '" + this.name
+ "' is too long ( > "
+ NAMELEN + " bytes)");
}
}
/**


Loading…
Cancel
Save