summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Sully <john@csquare.ca>2019-07-29 18:11:52 -0400
committerantirez <antirez@gmail.com>2019-07-30 10:28:14 +0200
commitdce11e658c9c3a29cab5ba87d72fa0a2c4ff13db (patch)
tree5ad8b6fbfb7e8feadfcfe1721d0a7b06e6268fce
parent18572a921a8d17881c3de1fc71f56362d63010d9 (diff)
downloadredis-dce11e658c9c3a29cab5ba87d72fa0a2c4ff13db.tar.gz
Fix HLL corruption bug
-rw-r--r--src/hyperloglog.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index c0f20815c..6b18d1417 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -698,6 +698,7 @@ int hllSparseSet(robj *o, long index, uint8_t count) {
first += span;
}
if (span == 0) return -1; /* Invalid format. */
+ if (span >= end) return -1; /* Invalid format. */
next = HLL_SPARSE_IS_XZERO(p) ? p+2 : p+1;
if (next >= end) next = NULL;