Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 53031 invoked by uid 500); 21 Jan 2001 00:43:23 -0000 Delivered-To: apmail-jakarta-ant-cvs@apache.org Received: (qmail 53028 invoked by uid 1195); 21 Jan 2001 00:43:23 -0000 Date: 21 Jan 2001 00:43:23 -0000 Message-ID: <20010121004323.53027.qmail@apache.org> From: donaldp@apache.org To: jakarta-ant-cvs@apache.org Subject: 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" 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)"); + } } /**