httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r1372054 - in /httpd/httpd/trunk: CHANGES server/util.c
Date Sun, 12 Aug 2012 13:15:17 GMT


humbedooh@apache.org wrote:
> Author: humbedooh
> Date: Sun Aug 12 07:45:55 2012
> New Revision: 1372054
> 
> URL: http://svn.apache.org/viewvc?rev=1372054&view=rev
> Log:
> core:
> Be less strict when checking whether Content-Type is set to "application/x-www-form-urlencoded"

> when parsing POST data, or we risk losing data with an appended charset.
> 
> PR 53698
> Reported by: Petter Berntsen < sluggr gmail.com >
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/server/util.c
> 

> Modified: httpd/httpd/trunk/server/util.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1372054&r1=1372053&r2=1372054&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/util.c (original)
> +++ httpd/httpd/trunk/server/util.c Sun Aug 12 07:45:55 2012
> @@ -2406,7 +2406,7 @@ AP_DECLARE(int) ap_parse_form_data(reque
>  
>      /* sanity check - we only support forms for now */
>      ct = apr_table_get(r->headers_in, "Content-Type");
> -    if (!ct || strcmp("application/x-www-form-urlencoded", ct)) {
> +    if (!ct || ap_strcmp_match(ct, "application/x-www-form-urlencoded*")) {

ap_strcmp_match seems to be a lot of overhead for just prefix matching a string.
How about

 strncmp("application/x-www-form-urlencoded", ct, 33)

instead.

Regards

RĂ¼diger


Mime
View raw message