diff options
author | Kim Alvefur <zash@zash.se> | 2013-11-28 16:12:40 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-11-28 16:12:40 +0100 |
commit | d76cb457bf816f506b1b12e56fa709d56644082c (patch) | |
tree | 970f113ae768ce4ffe0240945cf6ca6a6b1778ae /util-src/pposix.c | |
parent | c3132dda0940341ef56574ab56fbbeb7334db387 (diff) | |
download | prosody-d76cb457bf816f506b1b12e56fa709d56644082c.tar.gz prosody-d76cb457bf816f506b1b12e56fa709d56644082c.zip |
util.pposix: Verify that file handle is open
Diffstat (limited to 'util-src/pposix.c')
-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 7f64038b..4fb1fb56 100644 --- a/util-src/pposix.c +++ b/util-src/pposix.c @@ -666,6 +666,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); |