From d4b56d58199111e536f49bf01f71bd112778b12b Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 3 Mar 2009 23:24:19 +0000 Subject: [PATCH] added more asserts to BLOBHeap.flushBuffer() to fix the problem described in http://forum.yacy-websuche.de/viewtopic.php?f=6&t=1679&hilit=&p=13109#p13109 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5666 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/blob/BLOBHeap.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/de/anomic/kelondro/blob/BLOBHeap.java b/source/de/anomic/kelondro/blob/BLOBHeap.java index 56e8b9f91..a91618b0c 100755 --- a/source/de/anomic/kelondro/blob/BLOBHeap.java +++ b/source/de/anomic/kelondro/blob/BLOBHeap.java @@ -170,8 +170,11 @@ public final class BLOBHeap extends BLOBHeapModifier implements BLOB { index.putl(key, posFile); b = AbstractRandomAccess.int2array(key.length + blob.length); assert b.length == 4; + assert posBuffer + 4 < ba.length : "posBuffer = " + posBuffer + ", ba.length = " + ba.length; System.arraycopy(b, 0, ba, posBuffer, 4); + assert posBuffer + 4 + key.length <= ba.length : "posBuffer = " + posBuffer + ", key.length = " + key.length + ", ba.length = " + ba.length; System.arraycopy(key, 0, ba, posBuffer + 4, key.length); + assert posBuffer + 4 + key.length + blob.length <= ba.length : "posBuffer = " + posBuffer + ", key.length = " + key.length + ", blob.length = " + blob.length + ", ba.length = " + ba.length; System.arraycopy(blob, 0, ba, posBuffer + 4 + key.length, blob.length); posFile += 4 + key.length + blob.length; posBuffer += 4 + key.length + blob.length;