summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2017-04-24 14:33:47 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2017-05-10 00:33:44 +0200
commit501af12c19a4f7dfa0b22e46cdf19cc306370565 (patch)
treec52e875188015a0c79ac0ac66ab2daeb4b711c6f /org.eclipse.jgit
parent5b84e25fa3afe66bbfa7eb953ea0bd332c745ecd (diff)
downloadjgit-501af12c19a4f7dfa0b22e46cdf19cc306370565.tar.gz
jgit-501af12c19a4f7dfa0b22e46cdf19cc306370565.zip
Checkout should not use too long filenames
DirCacheCheckout is generating names for temporary files. It was not checking the length of this filenames. It may happen that a generated filename is longer than 255 chars which causes problems on certain platforms. Make sure that filenames for temporary files do not exceed 255 chars. Bug: 508823 Change-Id: I9475c04351ce3faebdc6ad40ea4faa3c326815f4
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java7
1 files changed, 6 insertions, 1 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 84f0da9e88..aed76ac66b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -1299,8 +1299,13 @@ public class DirCacheCheckout {
return;
}
+ String name = f.getName();
+ if (name.length() > 200) {
+ name = name.substring(0, 200);
+ }
File tmpFile = File.createTempFile(
- "._" + f.getName(), null, parentDir); //$NON-NLS-1$
+ "._" + name, null, parentDir); //$NON-NLS-1$
+
EolStreamType nonNullEolStreamType;
if (checkoutMetadata.eolStreamType != null) {
nonNullEolStreamType = checkoutMetadata.eolStreamType;