httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1424723 - /httpd/httpd/trunk/modules/lua/lua_request.c
Date Thu, 20 Dec 2012 21:52:04 GMT
Author: humbedooh
Date: Thu Dec 20 21:52:03 2012
New Revision: 1424723

URL: http://svn.apache.org/viewvc?rev=1424723&view=rev
Log:
mod_lua: Fix multipart post parsing, so it doesn't include random bytes at the end.

Modified:
    httpd/httpd/trunk/modules/lua/lua_request.c

Modified: httpd/httpd/trunk/modules/lua/lua_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=1424723&r1=1424722&r2=1424723&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Thu Dec 20 21:52:03 2012
@@ -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[^\"]\"",



Mime
View raw message