summaryrefslogtreecommitdiff
path: root/src/hyperloglog.c
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:12 +0200
commit680f89fbf9278a10b0598d7a3bdb49101e47b2f2 (patch)
tree6a8952eae0bd6cd39d12fb23dfdcd6c79fe21876 /src/hyperloglog.c
parent388efbf8b661ce2e5db447e994bf3c3caf6403c6 (diff)
downloadredis-680f89fbf9278a10b0598d7a3bdb49101e47b2f2.tar.gz
Fix HLL corruption bug
Diffstat (limited to 'src/hyperloglog.c')
-rw-r--r--src/hyperloglog.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index 19dc71000..33d3d4bf0 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -701,6 +701,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;