summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-04-23 11:16:25 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-04-23 11:16:25 -0700
commitdafa8fbff42be3c644061fa6c81d149097bd31fd (patch)
treef02f7d114bdadb2748a4f0f8ff367d23cf949e6d /org.eclipse.jgit
parent0f95d2d0462f8badd3cdb1fadb6dbb3fe84074b4 (diff)
downloadjgit-dafa8fbff42be3c644061fa6c81d149097bd31fd.tar.gz
jgit-dafa8fbff42be3c644061fa6c81d149097bd31fd.zip
Fix NPE during InflaterCache return after corrupt loose object
If a corrupt loose object is read, UnpackedObjectLoader was disposing of the Inflater, and then attempting to return the disposed Inflater to the InflaterCache. Since the disposed Inflater had its native libz resource deallocated and its reference cleared out, the Inflater threw NullPointerException and refused to reset itself before being put back into the cache. Instead of disposing of the Inflater when corruption is found, do nothing, and allow it to be returned to the cache. The instance will get reset, and should be usable by a future caller. Bug: 310291 Change-Id: I44f2247c08b6e04fa62f8399609341b07508c096 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/UnpackedObjectLoader.java1
1 files changed, 0 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/UnpackedObjectLoader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/UnpackedObjectLoader.java
index 968dada0cd..005df4b98d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/UnpackedObjectLoader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/UnpackedObjectLoader.java
@@ -120,7 +120,6 @@ public class UnpackedObjectLoader extends ObjectLoader {
final CorruptObjectException coe;
coe = new CorruptObjectException(id, "bad stream");
coe.initCause(dfe);
- inflater.end();
throw coe;
}
if (avail < 5)