diff --git a/server/core.c b/server/core.c index a1a7fb52286..a6928ef916c 100644 --- a/server/core.c +++ b/server/core.c @@ -3921,12 +3921,13 @@ static const char *set_limit_xml_req_body(cmd_parms *cmd, void *conf_, core_dir_config *conf = conf_; apr_uint64_t max = AP_MAX_LIMIT_XML_BODY; apr_off_t limit; - char *errp; + apr_status_t rv; - if (APR_SUCCESS != apr_strtoff(&limit, arg, &errp, 10)) { + rv = ap_size_parameter_parse(arg, &limit); + if (rv == APR_ERANGE) { return "LimitXMLRequestBody argument is not parsable."; } - if (*errp || limit < 0) { + if (rv != APR_SUCCESS || limit < 0) { return "LimitXMLRequestBody requires a non-negative integer."; } diff --git a/test/modules/core/test_012_config_off_t.py b/test/modules/core/test_012_config_off_t.py index c7b3bd477ff..a21facdcf66 100644 --- a/test/modules/core/test_012_config_off_t.py +++ b/test/modules/core/test_012_config_off_t.py @@ -7,7 +7,7 @@ # size and time directives parsed with ap_size_parameter_parse(), which can # not be negative DIRECTIVES = [ - "LimitRequestBody", + "LimitRequestBody", "LimitXMLRequestBody", "ScriptLogLength", "ScriptLogBuffer", "CacheMinFileSize", "CacheMaxFileSize", "CacheReadSize", "CacheReadTime", "CacheSocacheMaxTime", "CacheSocacheMinTime", "CacheSocacheReadSize",