From d0023c3c8f1efed0ff54de42541efed01224f424 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Mon, 24 Oct 2016 09:29:30 +0200 Subject: [PATCH] Don't serialize internal hash collision chain link ObjectId is serializable, and so are its subtypes. Ensure that serialization does not follow the hash collision chain internal to the ObjectIdOwnerMap, otherwise completely unrelated objects may get serialized when a RevObject is serialized. Note that serializing a RevCommit or RevTag may serialize quite a few objects due to the parent/object links they contain. A user has no real control over how many objects will be written when a RevCommit is serialized. C.f [1]. This change does not resolve that, but in any case this internal hash collision chain link should not participate in serialization. [1] https://github.com/gitblit/gitblit/pull/1141 Change-Id: Ice331a9dc80a59ca360fcc04adaff8b5e750d847 Signed-off-by: Thomas Wolf --- org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java index 442261cbd5..f6613d5832 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java @@ -341,7 +341,7 @@ public class ObjectIdOwnerMap /** Type of entry stored in the {@link ObjectIdOwnerMap}. */ public static abstract class Entry extends ObjectId { - Entry next; + transient Entry next; /** * Initialize this entry with a specific ObjectId. -- 2.39.5