summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-09-01 11:08:44 +0200
committerantirez <antirez@gmail.com>2016-09-01 11:08:44 +0200
commit57a0db94956441ac14a252cd09daa45e3f3a9453 (patch)
tree4d76bae64629d01688a3dfb649ea5b2e2d568989
parent9f76d82689e1d31189761f9ea4ba7b6f42ed33d1 (diff)
downloadredis-57a0db94956441ac14a252cd09daa45e3f3a9453.tar.gz
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.
-rw-r--r--src/rdb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rdb.c b/src/rdb.c
index 859297943..58cde1f28 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -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;