diff options
author | Matt Stancliff <matt@genges.com> | 2014-06-28 22:20:44 -0400 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-08-27 10:24:15 +0200 |
commit | 4024220fe6ab7a233c7ea8d97f5498136285fdaf (patch) | |
tree | 48a48c7d26e411b0c74371d346f81bc1204884e7 /tests | |
parent | 50669f7b66b0c1f95596d6319de321ccd7f02a88 (diff) | |
download | redis-4024220fe6ab7a233c7ea8d97f5498136285fdaf.tar.gz |
scripting: no eval with negative key count
Negative key count causes segfault in Lua functions.
Fixes #1842
Closes #1843
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/scripting.tcl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl index 4190a0a49..d0c6f5d7a 100644 --- a/tests/unit/scripting.tcl +++ b/tests/unit/scripting.tcl @@ -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 |