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.
Index: TarEntry.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/tar/TarEntry.java,v
retrieving revision 1.2
diff -u -r1.2 TarEntry.java
--- TarEntry.java 2001/01/03 14:18:48 1.2
+++ TarEntry.java 2001/01/20 20:52:40
@@ -177,6 +177,12 @@
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)");
+ }
}
/**