summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-14 10:25:19 +0200
committerantirez <antirez@gmail.com>2014-04-14 10:25:19 +0200
commit1ee18db922aaf03cc1e0f04a5b0d9764f9d0ceb5 (patch)
treeac7be451eaedc3394a5f3436442f92c41b15b1d3
parent82c31f750d71686f0412085ff35f67b37b407cc6 (diff)
downloadredis-1ee18db922aaf03cc1e0f04a5b0d9764f9d0ceb5.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;