Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c151eb6d
Commit
c151eb6d
authored
Jul 28, 2013
by
antirez
Browse files
Fix replicationFeedSlaves() off-by-one bug.
This fixes issue #1221.
parent
bf56948f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
c151eb6d
...
@@ -188,7 +188,7 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
...
@@ -188,7 +188,7 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
b
[
0
]
=
'*'
;
b
[
0
]
=
'*'
;
len
=
ll2string
(
b
+
1
,
REDIS_LONGSTR_SIZE
,
argc
);
len
=
ll2string
(
b
+
1
,
REDIS_LONGSTR_SIZE
,
argc
);
b
+=
len
+
1
;
b
+=
len
+
1
;
buf_left
-=
len
;
buf_left
-=
len
+
1
;
b
[
0
]
=
'\r'
;
b
[
0
]
=
'\r'
;
b
[
1
]
=
'\n'
;
b
[
1
]
=
'\n'
;
b
+=
2
;
b
+=
2
;
...
@@ -219,7 +219,7 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
...
@@ -219,7 +219,7 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
b
[
0
]
=
'$'
;
b
[
0
]
=
'$'
;
len
=
ll2string
(
b
+
1
,
REDIS_LONGSTR_SIZE
,
objlen
);
len
=
ll2string
(
b
+
1
,
REDIS_LONGSTR_SIZE
,
objlen
);
b
+=
len
+
1
;
b
+=
len
+
1
;
buf_left
-=
len
;
buf_left
-=
len
+
1
;
b
[
0
]
=
'\r'
;
b
[
0
]
=
'\r'
;
b
[
1
]
=
'\n'
;
b
[
1
]
=
'\n'
;
b
+=
2
;
b
+=
2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment