# HG changeset patch # User Kim Alvefur # Date 1385651841 -3600 # Node ID 1f6923702fc3765867178508cbecae1b2d6324b2 # Parent 826c522f303a5e21b08245307c9ab5b7ef05f19b# Parent 49e3c49eb0d8f33e94e2bf37e5421deacac5f499 Merge 0.9->0.10 diff -r 826c522f303a -r 1f6923702fc3 util-src/pposix.c --- 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);