692b48
diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c
692b48
index 77a88b4..1d8be2e 100644
692b48
--- a/modules/lua/lua_request.c
692b48
+++ b/modules/lua/lua_request.c
692b48
@@ -376,6 +376,7 @@ static int req_parsebody(lua_State *L)
692b48
             if (end == NULL) break;
692b48
             key = (char *) apr_pcalloc(r->pool, 256);
692b48
             filename = (char *) apr_pcalloc(r->pool, 256);
692b48
+            if (end - crlf <= 8) break;
692b48
             vlen = end - crlf - 8;
692b48
             buffer = (char *) apr_pcalloc(r->pool, vlen+1);
692b48
             memcpy(buffer, crlf + 4, vlen);