Fix rdb.c var types when calling rdbLoadLen().

Technically as soon as Redis 64 bit gets proper support for loading
collections and/or DBs with more than 2^32 elements, the 32 bit version
should be modified in order to check if what we read from rdbLoadLen()
overflows. This would only apply to huge RDB files created with a 64 bit
instance and later loaded into a 32 bit instance.
This commit is contained in:
antirez 2016-09-01 11:08:44 +02:00
parent 9f76d82689
commit 57a0db9495

View File

@ -1052,7 +1052,7 @@ void rdbRemoveTempFile(pid_t childpid) {
* On success a newly allocated object is returned, otherwise NULL. */
robj *rdbLoadObject(int rdbtype, rio *rdb) {
robj *o = NULL, *ele, *dec;
size_t len;
uint64_t len;
unsigned int i;
if (rdbtype == RDB_TYPE_STRING) {
@ -1119,7 +1119,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
}
} else if (rdbtype == RDB_TYPE_ZSET_2 || rdbtype == RDB_TYPE_ZSET) {
/* Read list/set value. */
size_t zsetlen;
uint64_t zsetlen;
size_t maxelelen = 0;
zset *zs;
@ -1154,7 +1154,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
maxelelen <= server.zset_max_ziplist_value)
zsetConvert(o,OBJ_ENCODING_ZIPLIST);
} else if (rdbtype == RDB_TYPE_HASH) {
size_t len;
uint64_t len;
int ret;
sds field, value;