summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-25 18:43:19 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-25 18:43:19 +0000
commit520ab0860305e65ee3078ca3ec7071fec1d38f29 (patch)
tree862e1cf2c36ca612c34f9827e1e1c39809bfcf26 /crawl-ref/source/clua.cc
parentad60a0a5597735c48dab0fbda1a7e61d96247d97 (diff)
downloadcrawl-ref-520ab0860305e65ee3078ca3ec7071fec1d38f29.tar.gz
crawl-ref-520ab0860305e65ee3078ca3ec7071fec1d38f29.zip
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
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r--crawl-ref/source/clua.cc6
1 files changed, 5 insertions, 1 deletions
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()));
}