summaryrefslogtreecommitdiff
path: root/src/rdb.h
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-11-20 18:12:15 +0800
committerGitHub <noreply@github.com>2022-11-20 12:12:15 +0200
commit51887e61b8a0ae36fa977351f34ace3e38efbc29 (patch)
tree0882ec27cb4cb154d92872ab1a8a9b26bb509c03 /src/rdb.h
parent2f411770c85ddfd226c02819c0f98a3f5a7854ac (diff)
downloadredis-51887e61b8a0ae36fa977351f34ace3e38efbc29.tar.gz
sanitize dump payload: fix crash with empty set with listpack encoding (#11519)
The following example will create an empty set (listpack encoding): ``` > RESTORE key 0 "\x14\x25\x25\x00\x00\x00\x00\x00\x02\x01\x82\x5F\x37\x03\x06\x01\x82\x5F\x35\x03\x82\x5F\x33\x03\x00\x01\x82\x5F\x31\x03\x82\x5F\x39\x03\x04\xA9\x08\x01\xFF\x0B\x00\xA3\x26\x49\xB4\x86\xB0\x0F\x41" OK > SCARD key (integer) 0 > SRANDMEMBER key Error: Server closed the connection ``` In the spirit of #9297, skip empty set when loading RDB_TYPE_SET_LISTPACK. Introduced in #11290
Diffstat (limited to 'src/rdb.h')
-rw-r--r--src/rdb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rdb.h b/src/rdb.h
index 4350d3a28..b8c25865c 100644
--- a/src/rdb.h
+++ b/src/rdb.h
@@ -158,7 +158,7 @@ void rdbRemoveTempFile(pid_t childpid, int from_signal);
int rdbSave(int req, char *filename, rdbSaveInfo *rsi);
ssize_t rdbSaveObject(rio *rdb, robj *o, robj *key, int dbid);
size_t rdbSavedObjectLen(robj *o, robj *key, int dbid);
-robj *rdbLoadObject(int type, rio *rdb, sds key, int dbid, int *error);
+robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, int dbid, int *error);
void backgroundSaveDoneHandler(int exitcode, int bysignal);
int rdbSaveKeyValuePair(rio *rdb, robj *key, robj *val, long long expiretime,int dbid);
ssize_t rdbSaveSingleModuleAux(rio *rdb, int when, moduleType *mt);