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
f797c7dc
Commit
f797c7dc
authored
Apr 05, 2011
by
antirez
Browse files
bad data on RESTORE can no longer crash the server but create a memory leak with some input string
parent
f304f22b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
f797c7dc
...
@@ -1140,8 +1140,10 @@ void restoreCommand(redisClient *c) {
...
@@ -1140,8 +1140,10 @@ void restoreCommand(redisClient *c) {
/* Finally create the object from the serialized dump and
/* Finally create the object from the serialized dump and
* store it at the specified key. */
* store it at the specified key. */
o
=
rdbLoadObject
(
data
[
0
],
fp
);
if
((
data
[
0
]
>
4
&&
data
[
0
]
<
9
)
||
if
(
o
==
NULL
)
{
data
[
0
]
>
11
||
(
o
=
rdbLoadObject
(
data
[
0
],
fp
))
==
NULL
)
{
addReplyError
(
c
,
"Bad data format."
);
addReplyError
(
c
,
"Bad data format."
);
fclose
(
fp
);
fclose
(
fp
);
return
;
return
;
...
...
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