mirror of
https://github.com/fluencelabs/redis
synced 2025-03-25 20:01:04 +00:00
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:
parent
9f76d82689
commit
57a0db9495
@ -1052,7 +1052,7 @@ void rdbRemoveTempFile(pid_t childpid) {
|
|||||||
* On success a newly allocated object is returned, otherwise NULL. */
|
* On success a newly allocated object is returned, otherwise NULL. */
|
||||||
robj *rdbLoadObject(int rdbtype, rio *rdb) {
|
robj *rdbLoadObject(int rdbtype, rio *rdb) {
|
||||||
robj *o = NULL, *ele, *dec;
|
robj *o = NULL, *ele, *dec;
|
||||||
size_t len;
|
uint64_t len;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (rdbtype == RDB_TYPE_STRING) {
|
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) {
|
} else if (rdbtype == RDB_TYPE_ZSET_2 || rdbtype == RDB_TYPE_ZSET) {
|
||||||
/* Read list/set value. */
|
/* Read list/set value. */
|
||||||
size_t zsetlen;
|
uint64_t zsetlen;
|
||||||
size_t maxelelen = 0;
|
size_t maxelelen = 0;
|
||||||
zset *zs;
|
zset *zs;
|
||||||
|
|
||||||
@ -1154,7 +1154,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
|
|||||||
maxelelen <= server.zset_max_ziplist_value)
|
maxelelen <= server.zset_max_ziplist_value)
|
||||||
zsetConvert(o,OBJ_ENCODING_ZIPLIST);
|
zsetConvert(o,OBJ_ENCODING_ZIPLIST);
|
||||||
} else if (rdbtype == RDB_TYPE_HASH) {
|
} else if (rdbtype == RDB_TYPE_HASH) {
|
||||||
size_t len;
|
uint64_t len;
|
||||||
int ret;
|
int ret;
|
||||||
sds field, value;
|
sds field, value;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user