From 789c94feceb7cb0b618dcb912c0151625d913887 Mon Sep 17 00:00:00 2001 From: "Meir Shpilraien (Spielrein)" Date: Sun, 17 Apr 2022 15:28:50 +0300 Subject: [PATCH] Added test to verify loading Lua binary payload is not possible (#10583) The tests verify that loading a binary payload to the Lua interpreter raises an error. The Lua code modification was done here: fdf9d455098f54f7666c702ae464e6ea21e25411 which force the Lau interpreter to always use the text parser. --- tests/unit/scripting.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl index 02eecefd7..1b8ae6df8 100644 --- a/tests/unit/scripting.tcl +++ b/tests/unit/scripting.tcl @@ -735,6 +735,12 @@ start_server {tags {"scripting"}} { return redis.acl_check_cmd('invalid-cmd','arg') } 0} } + + test "Binary code loading failed" { + assert_error {ERR *attempt to call a nil value*} {run_script { + return loadstring(string.dump(function() return 1 end))() + } 0} + } } # Start a new server since the last test in this stanza will kill the