From 0df22ef9f66dcfc922d22b7639593336f91b9a5f Mon Sep 17 00:00:00 2001 From: John Sully Date: Mon, 29 Jul 2019 18:08:45 -0400 Subject: [PATCH] Fix HLL corruption Former-commit-id: 47ef9e5cbd11dad107a68a94dfb51d192e86c84e --- src/hyperloglog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hyperloglog.cpp b/src/hyperloglog.cpp index 344fd219f..0b1239965 100644 --- a/src/hyperloglog.cpp +++ b/src/hyperloglog.cpp @@ -710,6 +710,7 @@ int hllSparseSet(robj *o, long index, uint8_t count) { first += span; } if (span == 0) return -1; /* Invalid format. */ + if (p >= end) return -1; /* Invalid format. */ next = HLL_SPARSE_IS_XZERO(p) ? p+2 : p+1; if (next >= end) next = NULL;