You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by hu...@apache.org on 2012/12/20 22:52:04 UTC

svn commit: r1424723 - /httpd/httpd/trunk/modules/lua/lua_request.c

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[^\"]\"",



Re: svn commit: r1424723 - /httpd/httpd/trunk/modules/lua/lua_request.c

Posted by Daniel Gruno <ru...@cord.dk>.
On 12/21/2012 03:45 PM, Guenter Knauf wrote:
> Hi Daniel,
> Am 20.12.2012 22:52, schrieb humbedooh@apache.org:
>> 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"
> what's that? probably non-intended commit?
> 
> ### mwccnlm Compiler:
> #    File: lua_request.c
> # ----------------------
> #      22:  #include "lua_dbd.h"
> #   Error:                     ^
> #   the file 'lua_dbd.h' cannot be opened
> #   Too many errors printed, aborting program
> 
> User break, cancelled...
> 
> Gün.
> 
argh, yes - that's the database project I'm working on. Seems I forgot
to remove all references to it, I'm sorry :/

I'll fix it right away!

With regards,
Daniel.

Re: svn commit: r1424723 - /httpd/httpd/trunk/modules/lua/lua_request.c

Posted by Guenter Knauf <fu...@apache.org>.
Hi Daniel,
Am 20.12.2012 22:52, schrieb humbedooh@apache.org:
> 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"
what's that? probably non-intended commit?

### mwccnlm Compiler:
#    File: lua_request.c
# ----------------------
#      22:  #include "lua_dbd.h"
#   Error:                     ^
#   the file 'lua_dbd.h' cannot be opened
#   Too many errors printed, aborting program

User break, cancelled...

Gün.