"vscode:/vscode.git/clone" did not exist on "e8614a1a77d2989f7be3cb7b24cd88b01f14f17e"
Commit 57a0db94 authored by antirez's avatar antirez
Browse files

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.
parent 9f76d826
...@@ -1052,7 +1052,7 @@ void rdbRemoveTempFile(pid_t childpid) { ...@@ -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) { ...@@ -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) { ...@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment