huber 2004/07/16 17:03:27
Modified: src/java/org/apache/cocoon/util IOUtils.java
Log:
fix handling of normalizedFilename handling of "..", replace decrement of i
by decrement of lio
this fix avoids looping in case of normalizing a filename containing "..",
the bug was introduced in rev 1.5,
the testcase IOUtilsTestCase shall run now
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.8 +2 -2 cocoon-2.1/src/java/org/apache/cocoon/util/IOUtils.java
Index: IOUtils.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/util/IOUtils.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- IOUtils.java 12 Jul 2004 13:29:57 -0000 1.7
+++ IOUtils.java 17 Jul 2004 00:03:27 -0000 1.8
@@ -215,7 +215,7 @@
if (path[i].equals("..")) {
int lio;
- for (lio = buffer.length() - 2; lio >= 0; i--) {
+ for (lio = buffer.length() - 2; lio >= 0; lio--) {
if (buffer.substring(lio).startsWith(File.separator)) {
break;
}