summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-10-14 16:08:39 +0200
committerGitHub <noreply@github.com>2019-10-14 16:08:39 +0200
commit05872ff6ae45a6b71bb23021939153a4fd9fefd3 (patch)
tree8354114b2f2a5a5eeb3e756c89647f1202e4526f
parentd374a9ae6c3ceeaa98a9e7eb782dbbce7528dcf8 (diff)
parent023955bf4732172a4b4e210cf04405c43d00bad3 (diff)
Merge pull request #10975 from vespa-engine/balder/do-not-read-uninitialized-memory
Do not read past the end.
-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]];