From 02e91f38f651379d6d80c7898fd466e1666399b8 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 17 Jul 2011 08:52:35 +0000 Subject: [PATCH] Fix parsing of Content-Length in type maps PR: 42203 Submitted by: Nagae Hidetake git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147557 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/mappers/mod_negotiation.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 408ab07b7c..eab33cecbf 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.14 + *) mod_negotiation: Fix parsing of Content-Length in type maps. PR 42203. + [Nagae Hidetake ] + *) 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. diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 101beeb27d..508d8f4ad8 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -996,12 +996,13 @@ static int read_type_map(apr_file_t **map, negotiation_state *neg, 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; -- 2.49.0