Changeset

5928:1f6923702fc3

Merge 0.9->0.10
author Kim Alvefur <zash@zash.se>
date Thu, 28 Nov 2013 16:17:21 +0100
parents 5925:826c522f303a (current diff) 5927:49e3c49eb0d8 (diff)
children 5929:e6d5956d05e6 5931:1c702c2455d7
files util-src/pposix.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
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);