diff options
author | Binbin <binloveplay1314@qq.com> | 2021-07-18 21:47:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-18 16:47:33 +0300 |
commit | e7ccdeebc9b3e3b663ac39a54d05483a7fdc7eb6 (patch) | |
tree | 81a02fd7a0d46da362fba173db567628a96ca7de /src/t_zset.c | |
parent | ee4bdf10eee1ebf988b6d00ec8bdb212948e364d (diff) | |
download | redis-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.c | 2 |
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)); |