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.
This commit is contained in:
Binbin 2023-11-29 20:25:17 +08:00 committed by GitHub
parent 3431b1f156
commit bdceaf50e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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