]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1895970 from trunk:
authorStefan Eissing <icing@apache.org>
Thu, 16 Dec 2021 11:15:47 +0000 (11:15 +0000)
committerStefan Eissing <icing@apache.org>
Thu, 16 Dec 2021 11:15:47 +0000 (11:15 +0000)
  *) mod_lua: Improve error handling

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1896039 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_request.c

index 67ff432e51f9541e38a6498f072e5e53d965b400..493b2bb431c26ed842b8134a5bfae118b3096539 100644 (file)
@@ -410,6 +410,7 @@ static int req_parsebody(lua_State *L)
             if (end == NULL) break;
             key = (char *) apr_pcalloc(r->pool, 256);
             filename = (char *) apr_pcalloc(r->pool, 256);
+            if (end - crlf <= 8) break;
             vlen = end - crlf - 8;
             buffer = (char *) apr_pcalloc(r->pool, vlen+1);
             memcpy(buffer, crlf + 4, vlen);