From 520ab0860305e65ee3078ca3ec7071fec1d38f29 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Thu, 25 Oct 2007 18:43:19 +0000 Subject: Fixed bug that would allow Lua dofile on arbitrary files using absolute paths. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2578 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/clua.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/clua.cc') diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 8c7582b69e..8943fc3bb3 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -257,7 +257,11 @@ int CLua::loadfile(lua_State *ls, const char *filename, bool trusted, std::string file = datafile_path(filename, die_on_fail); if (file.empty()) - file = filename; + { + lua_pushstring(ls, + make_stringf("Can't find \"%s\"", filename).c_str()); + return (-1); + } return (luaL_loadfile(ls, file.c_str())); } -- cgit v1.2.3-54-g00ecf