diff options
author | Daniel Gruno <humbedooh@apache.org> | 2012-12-20 22:52:03 +0100 |
---|---|---|
committer | Daniel Gruno <humbedooh@apache.org> | 2012-12-20 22:52:03 +0100 |
commit | 8767ad99884f2ecdf74e8ffdf545863c284fd56c (patch) | |
tree | 66398ffe86be962899982b157fe6dcc20da3d9ec | |
parent | On NetWare skip these unsupported function prototypes. (diff) | |
download | apache2-8767ad99884f2ecdf74e8ffdf545863c284fd56c.tar.xz apache2-8767ad99884f2ecdf74e8ffdf545863c284fd56c.zip |
mod_lua: Fix multipart post parsing, so it doesn't include random bytes at the end.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1424723 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | modules/lua/lua_request.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c index fdf689cf91..a6647629af 100644 --- a/modules/lua/lua_request.c +++ b/modules/lua/lua_request.c @@ -19,6 +19,7 @@ #include "util_script.h" #include "lua_apr.h" #include "scoreboard.h" +#include "lua_dbd.h" APLOG_USE_MODULE(lua); #define POST_MAX_VARS 500 @@ -246,8 +247,8 @@ static int req_parsebody(lua_State *L) if (!crlf) break; key = (char *) apr_pcalloc(r->pool, 256); filename = (char *) apr_pcalloc(r->pool, 256); - buffer = (char *) apr_palloc(r->pool, end - crlf); vlen = end - crlf - 8; + buffer = (char *) apr_pcalloc(r->pool, vlen+1); memcpy(buffer, crlf + 4, vlen); sscanf(start + len + 2, "Content-Disposition: form-data; name=\"%255[^\"]\"; filename=\"%255[^\"]\"", |