]> git.saurik.com Git - redis.git/commitdiff
Fix integer overflow in zunionInterGenericCommand().
authorantirez <antirez@gmail.com>
Thu, 22 Nov 2012 14:28:28 +0000 (15:28 +0100)
committerantirez <antirez@gmail.com>
Thu, 22 Nov 2012 14:28:45 +0000 (15:28 +0100)
This fixes issue #761.

src/t_zset.c

index f641d887cf4107b8cebe8d14b94df46642dd9dd8..f5cdec3e4bce2c55c2140941372b951f1526f051 100644 (file)
@@ -1497,7 +1497,7 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
     }
 
     /* test if the expected number of keys would overflow */
-    if (3+setnum > c->argc) {
+    if (setnum > c->argc-3) {
         addReply(c,shared.syntaxerr);
         return;
     }