summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-10-14 10:50:32 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-10-14 10:50:32 +0000
commit023955bf4732172a4b4e210cf04405c43d00bad3 (patch)
treec54a969a20f616b804cfa8cc193c16bba469ec91 /searchlib
parentb31de6acc6b24a6f4c6596385ee20df552701ce3 (diff)
Do not read past the end.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/query/query.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/query/query.cpp b/searchlib/src/vespa/searchlib/query/query.cpp
index 82420c64e2b..5887ba395eb 100644
--- a/searchlib/src/vespa/searchlib/query/query.cpp
+++ b/searchlib/src/vespa/searchlib/query/query.cpp
@@ -177,7 +177,7 @@ SameElementQueryNode::evaluateHits(HitList & hl) const
while ((nextIndex < nextIndexMax) && (nextHL[nextIndex].elemId() < currElemId)) {
nextIndex++;
}
- if (nextHL[nextIndex].elemId() == currElemId) {
+ if ((nextIndex < nextIndexMax) && (nextHL[nextIndex].elemId() == currElemId)) {
currMatchCount++;
if ((currMatchCount+1) == numFields) {
Hit h = nextHL[indexVector[currMatchCount]];