mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Abort instead of crashing when loading bad stream master key.
See #5612.
This commit is contained in:
parent
0c12ebf6e7
commit
edd3939bef
@ -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");
|
||||||
|
Loading…
Reference in New Issue
Block a user