projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2d1256
)
util.pposix: Verify that file handle is open
author
Kim Alvefur
<zash@zash.se>
Thu, 28 Nov 2013 15:12:40 +0000
(16:12 +0100)
committer
Kim Alvefur
<zash@zash.se>
Thu, 28 Nov 2013 15:12:40 +0000
(16:12 +0100)
util-src/pposix.c
patch
|
blob
|
history
diff --git
a/util-src/pposix.c
b/util-src/pposix.c
index 7f64038beb3bd07bd353396ee47de4502e1db0b8..4fb1fb56b5346f062d9310b70a8788c177320a09 100644
(file)
--- 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);