HyperLogLog: fix the fix of a corruption bug.

This commit is contained in:
antirez 2019-07-31 10:36:23 +02:00
parent dce11e658c
commit ff6db5f176

View File

@ -697,8 +697,7 @@ int hllSparseSet(robj *o, long index, uint8_t count) {
p += oplen;
first += span;
}
if (span == 0) return -1; /* Invalid format. */
if (span >= end) return -1; /* Invalid format. */
if (span == 0 || p >= end) return -1; /* Invalid format. */
next = HLL_SPARSE_IS_XZERO(p) ? p+2 : p+1;
if (next >= end) next = NULL;