Reject an empty argument list in execute_lua

`lua.execute` with no arguments dereferenced `args.begin()`.
This commit is contained in:
noctuum
2026-09-27 23:50:55 +05:00
committed by Jari Sundell
parent e656801cfa
commit 8e23ba8b17
+4
View File
@@ -394,6 +394,10 @@ execute_lua(LuaEngine* engine, rpc::target_type target_type, torrent::Object con
switch (raw_args.type()) {
case torrent::Object::TYPE_LIST: {
const torrent::Object::list_type& args = raw_args.as_list();
if (args.empty())
throw torrent::input_error("Too few arguments.");
if (flags & LuaEngine::flag_string) {
check_lua_status(l_state, luaL_loadstring(l_state, args.begin()->as_string().c_str()));
} else {