From 924e745b06e9fe44a0c602f25b8723209dacc699 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 24 Jan 2011 14:51:15 +0000 Subject: [PATCH] add assertion to check that skip pointer isn't past EOF git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1062810 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/lucene/index/codecs/MultiLevelSkipListReader.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lucene/src/java/org/apache/lucene/index/codecs/MultiLevelSkipListReader.java b/lucene/src/java/org/apache/lucene/index/codecs/MultiLevelSkipListReader.java index 0f65c818b16..b75aa478a5a 100644 --- a/lucene/src/java/org/apache/lucene/index/codecs/MultiLevelSkipListReader.java +++ b/lucene/src/java/org/apache/lucene/index/codecs/MultiLevelSkipListReader.java @@ -172,6 +172,8 @@ public abstract class MultiLevelSkipListReader { public void init(long skipPointer, int df) { this.skipPointer[0] = skipPointer; this.docCount = df; + assert skipPointer >= 0 && skipPointer <= skipStream[0].length() + : "invalid skip pointer: " + skipPointer + ", length=" + skipStream[0].length(); Arrays.fill(skipDoc, 0); Arrays.fill(numSkipped, 0); Arrays.fill(childPointer, 0);