Software /
code /
prosody
Diff
util-src/pposix.c @ 5928:1f6923702fc3
Merge 0.9->0.10
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 28 Nov 2013 16:17:21 +0100 |
parent | 5814:5cf1c08805fb |
parent | 5927:49e3c49eb0d8 |
child | 6156:6b1aee6536e8 |
line wrap: on
line diff
--- a/util-src/pposix.c Sun Nov 24 14:24:21 2013 +0100 +++ b/util-src/pposix.c Thu Nov 28 16:17:21 2013 +0100 @@ -676,6 +676,8 @@ { 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);