X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/7faa1f075b14882696af22d0613255018416ac92..62bfa66284eceae5dd06c9b3a06f0fb903e55f9d:/src/t_zset.c diff --git a/src/t_zset.c b/src/t_zset.c index d2535c72..50ad8d43 100644 --- a/src/t_zset.c +++ b/src/t_zset.c @@ -502,7 +502,7 @@ int zzlIsInRange(unsigned char *zl, zrangespec *range) { return 0; p = ziplistIndex(zl,-1); /* Last score. */ - redisAssert(p != NULL); + if (p == NULL) return 0; /* Empty sorted set */ score = zzlGetScore(p); if (!zslValueGteMin(score,range)) return 0; @@ -1254,12 +1254,14 @@ int zuiNext(zsetopsrc *op, zsetopval *val) { if (val->flags & OPVAL_DIRTY_ROBJ) decrRefCount(val->ele); - bzero(val,sizeof(zsetopval)); + memset(val,0,sizeof(zsetopval)); if (op->type == REDIS_SET) { iterset *it = &op->iter.set; if (op->encoding == REDIS_ENCODING_INTSET) { - if (!intsetGet(it->is.is,it->is.ii,(int64_t*)&val->ell)) + int64_t ell = val->ell; + + if (!intsetGet(it->is.is,it->is.ii,&ell)) return 0; val->score = 1.0;