Skip to content

Commit

Permalink
SCAN requires at least 1 argument
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern authored and antirez committed Oct 25, 2013
1 parent 7f490b1 commit 7a6cfb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ void scanCommand(redisClient *c) {
sds pat;
int patlen, patnoop = 1;

redisAssert(c->argc >= 2);

/* Use sscanf because we need an *unsigned* long */
rv = sscanf(c->argv[1]->ptr, "%lu", &cursor);
if (rv != 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ struct redisCommand redisCommandTable[] = {
{"pexpire",pexpireCommand,3,"w",0,NULL,1,1,1,0,0},
{"pexpireat",pexpireatCommand,3,"w",0,NULL,1,1,1,0,0},
{"keys",keysCommand,2,"rS",0,NULL,0,0,0,0,0},
{"scan",scanCommand,-1,"RS",0,NULL,0,0,0,0,0},
{"scan",scanCommand,-2,"RS",0,NULL,0,0,0,0,0},
{"dbsize",dbsizeCommand,1,"r",0,NULL,0,0,0,0,0},
{"auth",authCommand,2,"rslt",0,NULL,0,0,0,0,0},
{"ping",pingCommand,1,"rt",0,NULL,0,0,0,0,0},
Expand Down

0 comments on commit 7a6cfb1

Please sign in to comment.