Scripting: require at least one argument for redis.call().

Redis used to crash with a call like the following:

    EVAL "redis.call()" 0

Now the explicit check for at least one argument prevents the problem.

This commit fixes issue #655.
This commit is contained in:
antirez
2012-08-31 10:22:21 +02:00
parent 13732168a5
commit edfaa64f49
2 changed files with 13 additions and 0 deletions

View File

@ -145,6 +145,12 @@ start_server {tags {"scripting"}} {
set e
} {*not allowed after*}
test {EVAL - No arguments to redis.call/pcall is considered an error} {
set e {}
catch {r eval {return redis.call()} 0} e
set e
} {*one argument*}
test {EVAL - redis.call variant raises a Lua error on Redis cmd error (1)} {
set e {}
catch {