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
edd3939b
Commit
edd3939b
authored
Nov 28, 2018
by
antirez
Browse files
Abort instead of crashing when loading bad stream master key.
See #5612.
parent
0c12ebf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
edd3939b
...
@@ -1645,6 +1645,9 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
...
@@ -1645,6 +1645,9 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
* node: the entries inside the listpack itself are delta-encoded
* node: the entries inside the listpack itself are delta-encoded
* relatively to this ID. */
* relatively to this ID. */
sds
nodekey
=
rdbGenericLoadStringObject
(
rdb
,
RDB_LOAD_SDS
,
NULL
);
sds
nodekey
=
rdbGenericLoadStringObject
(
rdb
,
RDB_LOAD_SDS
,
NULL
);
if
(
nodekey
==
NULL
)
{
rdbExitReportCorruptRDB
(
"Stream master ID loading failed: invalid encoding or I/O error."
);
}
if
(
sdslen
(
nodekey
)
!=
sizeof
(
streamID
))
{
if
(
sdslen
(
nodekey
)
!=
sizeof
(
streamID
))
{
rdbExitReportCorruptRDB
(
"Stream node key entry is not the "
rdbExitReportCorruptRDB
(
"Stream node key entry is not the "
"size of a stream ID"
);
"size of a stream ID"
);
...
...
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