aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-11-28 16:17:51 +0100
committerKim Alvefur <zash@zash.se>2013-11-28 16:17:51 +0100
commit1d911dd1d1983c0a2fc604f99f26e76a19b361db (patch)
tree626dd6df98cae5d119fea0852d5fce67b6f73b89 /util-src
parent808d86f23f857721b310cfeba18884d2bb0f5301 (diff)
parente7c96bffc79157264598df0a293003a08d12da89 (diff)
downloadprosody-1d911dd1d1983c0a2fc604f99f26e76a19b361db.tar.gz
prosody-1d911dd1d1983c0a2fc604f99f26e76a19b361db.zip
Merge 0.10->trunk
Diffstat (limited to 'util-src')
-rw-r--r--util-src/pposix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util-src/pposix.c b/util-src/pposix.c
index 8ad167b7..73e0d6e3 100644
--- a/util-src/pposix.c
+++ b/util-src/pposix.c
@@ -676,6 +676,8 @@ int lc_fallocate(lua_State* L)
{
off_t offset, len;
FILE *f = *(FILE**) luaL_checkudata(L, 1, LUA_FILEHANDLE);
+ if (f == NULL)
+ luaL_error(L, "attempt to use a closed file");
offset = luaL_checkinteger(L, 2);
len = luaL_checkinteger(L, 3);