Commit 627abf22 authored by antirez's avatar antirez
Browse files

HyperLogLog: fix the fix of a corruption bug.

parent 6ef5a0cb
...@@ -688,8 +688,7 @@ int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) { ...@@ -688,8 +688,7 @@ int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
p += oplen; p += oplen;
first += span; first += span;
} }
if (span == 0) return -1; /* Invalid format. */ if (span == 0 || p >= end) return -1; /* Invalid format. */
if (span >= end) return -1; /* Invalid format. */
next = HLL_SPARSE_IS_XZERO(p) ? p+2 : p+1; next = HLL_SPARSE_IS_XZERO(p) ? p+2 : p+1;
if (next >= end) next = NULL; if (next >= end) next = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment