From 1ee18db922aaf03cc1e0f04a5b0d9764f9d0ceb5 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 14 Apr 2014 10:25:19 +0200 Subject: [PATCH] Fixed error message generation in PFDEBUG GETREG. Bulk length for registers was emitted too early, so if there was a bug the reply looked like a long array with just one element, blocking the client as result. --- src/hyperloglog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hyperloglog.c b/src/hyperloglog.c index d4c0a48d..1b675b2e 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -1246,12 +1246,13 @@ void pfdebugCommand(redisClient *c) { if (!strcasecmp(cmd,"getreg")) { if (c->argc != 3) goto arityerr; - addReplyMultiBulkLen(c,HLL_REGISTERS); if (hllSparseToDense(o) == REDIS_ERR) { addReplyError(c,"HLL sparse encoding is corrupted"); return; } + hdr = o->ptr; + addReplyMultiBulkLen(c,HLL_REGISTERS); for (j = 0; j < HLL_REGISTERS; j++) { uint8_t val;