You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by do...@apache.org on 2001/01/21 01:43:23 UTC
cvs commit: jakarta-ant/src/main/org/apache/tools/tar TarEntry.java
donaldp 01/01/20 16:43:23
Modified: src/main/org/apache/tools/tar TarEntry.java
Log:
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" <Ni...@epost.de>
Revision Changes Path
1.3 +6 -0 jakarta-ant/src/main/org/apache/tools/tar/TarEntry.java
Index: TarEntry.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/tar/TarEntry.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TarEntry.java 2001/01/03 14:18:48 1.2
+++ TarEntry.java 2001/01/21 00:43:22 1.3
@@ -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)");
+ }
}
/**