summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-07-28 12:49:07 +0200
committerantirez <antirez@gmail.com>2013-07-28 12:49:34 +0200
commitc151eb6d92ae69a8fecf14f7429d38929e0c75d0 (patch)
tree50f25d5a9ba49c8cc21f7efe8e174dd44164b06b
parentbf56948fd0c9dfd3bf7ac63e8dc50b47a4f6e98c (diff)
downloadredis-c151eb6d92ae69a8fecf14f7429d38929e0c75d0.tar.gz
Fix replicationFeedSlaves() off-by-one bug.
This fixes issue #1221.
-rw-r--r--src/replication.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/replication.c b/src/replication.c
index 3e8964ddd..2d7ee809d 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -188,7 +188,7 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
b[0] = '*';
len = ll2string(b+1,REDIS_LONGSTR_SIZE,argc);
b += len+1;
- buf_left -= len;
+ buf_left -= len+1;
b[0] = '\r';
b[1] = '\n';
b += 2;
@@ -219,7 +219,7 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
b[0] = '$';
len = ll2string(b+1,REDIS_LONGSTR_SIZE,objlen);
b += len+1;
- buf_left -= len;
+ buf_left -= len+1;
b[0] = '\r';
b[1] = '\n';
b += 2;