浏览代码

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>
tags/v0.8.1
Shawn O. Pearce 14 年前
父节点
当前提交
dafa8fbff4
共有 1 个文件被更改,包括 0 次插入1 次删除
  1. 0
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/UnpackedObjectLoader.java

+ 0
- 1
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)

正在加载...
取消
保存