You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/07/17 10:52:36 UTC

svn commit: r1147557 - in /httpd/httpd/trunk: CHANGES modules/mappers/mod_negotiation.c

Author: sf
Date: Sun Jul 17 08:52:35 2011
New Revision: 1147557

URL: http://svn.apache.org/viewvc?rev=1147557&view=rev
Log:
Fix parsing of Content-Length in type maps

PR: 42203
Submitted by: Nagae Hidetake <nagae eagan jp>

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/mappers/mod_negotiation.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1147557&r1=1147556&r2=1147557&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Jul 17 08:52:35 2011
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.3.14
 
+  *) mod_negotiation: Fix parsing of Content-Length in type maps. PR 42203.
+     [Nagae Hidetake <nagae eagan jp>]
+
   *) core: Add more logging to ap_scan_script_header_err* functions. Add
      ap_scan_script_header_err*_ex functions that take a module index for
      logging.

Modified: httpd/httpd/trunk/modules/mappers/mod_negotiation.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_negotiation.c?rev=1147557&r1=1147556&r2=1147557&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_negotiation.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_negotiation.c Sun Jul 17 08:52:35 2011
@@ -996,12 +996,13 @@ static int read_type_map(apr_file_t **ma
                 char *errp;
                 apr_off_t number;
 
-                if (apr_strtoff(&number, body, &errp, 10)
+                body1 = ap_get_token(neg->pool, &body, 0);
+                if (apr_strtoff(&number, body1, &errp, 10) != APR_SUCCESS
                     || *errp || number < 0) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                                   "Parse error in type map, Content-Length: "
                                   "'%s' in %s is invalid.",
-                                  body, r->filename);
+                                  body1, r->filename);
                     break;
                 }
                 mime_info.bytes = number;