summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-07-31 10:36:23 +0200
committerantirez <antirez@gmail.com>2019-07-31 10:37:03 +0200
commit627abf2289cca0045ca41325d7cf249577baaaf9 (patch)
tree0f00cba8cabb9922f16064e4be6801fdc4055441
parent6ef5a0cbbb464ef4f113153f47a7fc6950a6ce77 (diff)
downloadredis-3.2.tar.gz
HyperLogLog: fix the fix of a corruption bug.3.2
-rw-r--r--src/hyperloglog.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index e807e246f..de25cc991 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -688,8 +688,7 @@ int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
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;