summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2013-11-01 16:43:46 +0100
committerRobin Rosenberg <robin.rosenberg@dewire.com>2013-11-01 16:43:46 +0100
commit98bc384d2bd62f3abe7f8b14d8098b3445b6b6e3 (patch)
treefb5ce174927c89eb5baaa9820d88df2ce9da41ba /org.eclipse.jgit
parente649287502407e10c89de03e82cc0de855e01dcf (diff)
downloadjgit-98bc384d2bd62f3abe7f8b14d8098b3445b6b6e3.tar.gz
jgit-98bc384d2bd62f3abe7f8b14d8098b3445b6b6e3.zip
testMaliciousPathEmpty fails on Windows
Checking of spaces at the end of the file name caused the test to fail for Windows only. Bug: 396662 Change-Id: I47bcccb0fa32ce606276c3f30d454851d115ca11 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
index dd9ee10bf3..bd896864d7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -1202,8 +1202,9 @@ public class DirCacheCheckout {
// Space or period at end of file name is ignored by Windows.
// Treat this as a bad path for now. We may want to handle
// this as case insensitivity in the future.
- if (raw[ptr - 1] == '.' || raw[ptr - 1] == ' ')
- return false;
+ if (ptr > 0)
+ if (raw[ptr - 1] == '.' || raw[ptr - 1] == ' ')
+ return false;
int i;
// Bad names, eliminate suffix first
for (i = start; i < ptr; ++i)