From bdceaf50e4fbfbd063d26361a98ebcfc380d206c Mon Sep 17 00:00:00 2001 From: Binbin Date: Wed, 29 Nov 2023 20:25:17 +0800 Subject: [PATCH] Fix the check for new RDB_OPCODE_SLOT_INFO in redis-check-rdb (#12768) We did not read expires_slot_size, causing its check to fail. An overlook in #11695. --- src/redis-check-rdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/redis-check-rdb.c b/src/redis-check-rdb.c index c38284380..2344eec1c 100644 --- a/src/redis-check-rdb.c +++ b/src/redis-check-rdb.c @@ -277,11 +277,13 @@ int redis_check_rdb(char *rdbfilename, FILE *fp) { goto eoferr; continue; /* Read type again. */ } else if (type == RDB_OPCODE_SLOT_INFO) { - uint64_t slot_id, slot_size; + uint64_t slot_id, slot_size, expires_slot_size; if ((slot_id = rdbLoadLen(&rdb,NULL)) == RDB_LENERR) goto eoferr; if ((slot_size = rdbLoadLen(&rdb,NULL)) == RDB_LENERR) goto eoferr; + if ((expires_slot_size = rdbLoadLen(&rdb,NULL)) == RDB_LENERR) + goto eoferr; continue; /* Read type again. */ } else if (type == RDB_OPCODE_AUX) { /* AUX: generic string-string fields. Use to add state to RDB