f33ba3
diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c
f33ba3
index 61a14f5..1dc676f 100644
f33ba3
--- a/modules/lua/lua_request.c
f33ba3
+++ b/modules/lua/lua_request.c
f33ba3
@@ -303,6 +303,7 @@ static int req_parsebody(lua_State *L)
f33ba3
             if (!crlf) break;
f33ba3
             key = (char *) apr_pcalloc(r->pool, 256);
f33ba3
             filename = (char *) apr_pcalloc(r->pool, 256);
f33ba3
+            if (end - crlf <= 8) break;
f33ba3
             vlen = end - crlf - 8;
f33ba3
             buffer = (char *) apr_pcalloc(r->pool, vlen+1);
f33ba3
             memcpy(buffer, crlf + 4, vlen);