summaryrefslogtreecommitdiff
path: root/src/t_zset.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2021-07-18 21:47:33 +0800
committerGitHub <noreply@github.com>2021-07-18 16:47:33 +0300
commite7ccdeebc9b3e3b663ac39a54d05483a7fdc7eb6 (patch)
tree81a02fd7a0d46da362fba173db567628a96ca7de /src/t_zset.c
parentee4bdf10eee1ebf988b6d00ec8bdb212948e364d (diff)
downloadredis-e7ccdeebc9b3e3b663ac39a54d05483a7fdc7eb6.tar.gz
Fix rank overflow in zslInsert with more than 2B entries. (#9249)
If there are more than 2B entries in a zset. The calculated span will overflow.
Diffstat (limited to 'src/t_zset.c')
-rw-r--r--src/t_zset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_zset.c b/src/t_zset.c
index 28f1df05e..ce3b85f36 100644
--- a/src/t_zset.c
+++ b/src/t_zset.c
@@ -131,7 +131,7 @@ int zslRandomLevel(void) {
* of the passed SDS string 'ele'. */
zskiplistNode *zslInsert(zskiplist *zsl, double score, sds ele) {
zskiplistNode *update[ZSKIPLIST_MAXLEVEL], *x;
- unsigned int rank[ZSKIPLIST_MAXLEVEL];
+ unsigned long rank[ZSKIPLIST_MAXLEVEL];
int i, level;
serverAssert(!isnan(score));