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 13857 invoked by uid 500); 10 Oct 2000 16:27:27 -0000 Delivered-To: apmail-jakarta-ant-cvs@apache.org Received: (qmail 13846 invoked by uid 1192); 10 Oct 2000 16:27:25 -0000 Date: 10 Oct 2000 16:27:25 -0000 Message-ID: <20001010162725.13845.qmail@locus.apache.org> From: glennm@locus.apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java glennm 00/10/10 09:27:24 Modified: src/main/org/apache/tools/ant Project.java Log: Throws BuildException if it tries to resolve a path which will go further up than the root of the file-system. Reported by: Noris Boyd Patch submitted by: Nico Seessle Revision Changes Path 1.44 +5 -1 jakarta-ant/src/main/org/apache/tools/ant/Project.java Index: Project.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- Project.java 2000/10/04 09:57:55 1.43 +++ Project.java 2000/10/10 16:27:22 1.44 @@ -581,7 +581,11 @@ while (tok.hasMoreTokens()) { String part = tok.nextToken(); if (part.equals("..")) { - file = new File(file.getParent()); + String parentFile = file.getParent(); + if (parentFile == null) { + throw new BuildException("The file or path you specified (" + fileName + ") is invalid releative to " + baseDir.getAbsolutePath()); + } + file = new File(parentFile); } else if (part.equals(".")) { // Do nothing here } else {