scripting: no eval with negative key count

Negative key count causes segfault in Lua functions.

Fixes #1842
Closes #1843
This commit is contained in:
Matt Stancliff
2014-06-28 22:20:44 -04:00
committed by antirez
parent 9ac7787838
commit 9d4ebed9e9
2 changed files with 8 additions and 0 deletions

View File

@ -358,6 +358,11 @@ start_server {tags {"scripting"}} {
return redis.call("get", "key")
} 0
} {12039611435714932082}
test {Verify negative arg count is error instead of crash (issue #1842)} {
catch { r eval { return "hello" } -12 } e
set e
} {ERR Number of keys can't be negative}
}
# Start a new server since the last test in this stanza will kill the