diff options
author | Kim Alvefur <zash@zash.se> | 2013-11-28 16:17:21 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-11-28 16:17:21 +0100 |
commit | b8ab703419322fbc54dc75fe4e3cc33f5a41d4bc (patch) | |
tree | 13d5cf881ee61eaf917da190973143328e6f9697 | |
parent | 0aba6244bcd6d0b56be65229719fbd85a20e74b6 (diff) | |
parent | 6d5db18948d0838ee5d222b6dc3b6b4f4dec7d29 (diff) | |
download | prosody-b8ab703419322fbc54dc75fe4e3cc33f5a41d4bc.tar.gz prosody-b8ab703419322fbc54dc75fe4e3cc33f5a41d4bc.zip |
Merge 0.9->0.10
-rw-r--r-- | util-src/pposix.c | 2 |
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); |