summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-14 10:25:19 +0200
committerantirez <antirez@gmail.com>2014-04-16 15:26:27 +0200
commit29c7d1974b7b3583eaa22c74910fafe872dc0e9d (patch)
treeefeb10906007a3b77e4e3a3feff29f1259f959e0
parent023f2f7a10be636d77d2682434e44ca714908a0a (diff)
downloadredis-29c7d1974b7b3583eaa22c74910fafe872dc0e9d.tar.gz
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.
-rw-r--r--src/hyperloglog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index d4c0a48d4..1b675b2e8 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;