summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/resources
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2015-09-14 12:18:20 -0700
committerShawn Pearce <spearce@spearce.org>2015-09-14 12:53:34 -0700
commitb46c4463959f45b32e471e4c10b5ddc71232949e (patch)
tree035ba29440ca34bde7cfe111eb1798c63ef385d9 /org.eclipse.jgit/resources
parentdb0adc1e8cfeb19b2f25b6f1850c27865b570303 (diff)
downloadjgit-b46c4463959f45b32e471e4c10b5ddc71232949e.tar.gz
jgit-b46c4463959f45b32e471e4c10b5ddc71232949e.zip
UploadPack: Verify clients send only commits for shallow lines
If a client mistakenly tries to send a tag object as a shallow line JGit blindly assumes this is a commit and tries to parse the tag buffer using the commit parser. This can cause an obtuse error like: InvalidObjectIdException: Invalid id: t c0ff331234... The "t" comes from the "object c0ff331234..." line of the tag tring to be parsed as though it where the "tree" line of a commit. Run any client supplied shallow lines through the RevWalk to lookup the object types. Fail fast with a protocol exception if any of them are non-commit. Skip objects not known to this repository. This matches behavior with git-core's upload-pack, which sliently skips over any shallow line object named by the client but not known by the server. Change-Id: Ic6c57a90a42813164ce65c2244705fc42e84d700
Diffstat (limited to 'org.eclipse.jgit/resources')
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties1
1 files changed, 1 insertions, 0 deletions
diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
index 8ca3d9ae86..e2bed1873a 100644
--- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
+++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
@@ -344,6 +344,7 @@ invalidPathReservedOnWindows=Invalid path (''{0}'' is reserved on Windows): {1}
invalidReflogRevision=Invalid reflog revision: {0}
invalidRefName=Invalid ref name: {0}
invalidRemote=Invalid remote: {0}
+invalidShallowObject=invalid shallow object {0}, expected commit
invalidStageForPath=Invalid stage {0} for path {1}
invalidTagOption=Invalid tag option: {0}
invalidTimeout=Invalid timeout: {0}