Skip to content

Commit 8bc595e

Browse files
author
Zhang Zhang
authored
Fix out-of-bound array access in WQSummary::SetPrune() (#5493)
1 parent a108539 commit 8bc595e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/quantile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ struct WQSummary {
207207
// find first i such that d < (rmax[i+1] + rmin[i+1]) / 2
208208
while (i < src.size - 1
209209
&& dx2 >= src.data[i + 1].rmax + src.data[i + 1].rmin) ++i;
210-
CHECK(i != src.size - 1);
210+
if (i == src.size - 1) break;
211211
if (dx2 < src.data[i].RMinNext() + src.data[i + 1].RMaxPrev()) {
212212
if (i != lastidx) {
213213
data[size++] = src.data[i]; lastidx = i;

0 commit comments

Comments
 (0)