From edd3939bef97ada7943d9093308fdb68800c0cc3 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 28 Nov 2018 16:24:50 +0100 Subject: [PATCH] Abort instead of crashing when loading bad stream master key. See #5612. --- src/rdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rdb.c b/src/rdb.c index 3e43cb4e..47555101 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -1645,6 +1645,9 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) { * node: the entries inside the listpack itself are delta-encoded * relatively to this ID. */ 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)) { rdbExitReportCorruptRDB("Stream node key entry is not the " "size of a stream ID");