From: André Malo Date: Tue, 25 May 2004 18:01:02 +0000 (+0000) Subject: parse content-length correctly using new apr_strtoff function X-Git-Tag: pre_ajp_proxy~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b60c9417b2a027d8258549672881d1befe97711e;p=thirdparty%2Fapache%2Fhttpd.git parse content-length correctly using new apr_strtoff function git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103763 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/mod_cache.c b/modules/experimental/mod_cache.c index 410fbb2499e..f2bc9c5c0d0 100644 --- a/modules/experimental/mod_cache.c +++ b/modules/experimental/mod_cache.c @@ -597,9 +597,13 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in) cl = apr_table_get(r->headers_out, "Content-Length"); } if (cl) { - size = apr_atoi64(cl); + char *errp; + if (apr_strtoff(&size, cl, &errp, 10) || *errp || size < 0) { + cl = NULL; /* parse error, see next 'if' block */ + } } - else { + + if (!cl) { /* if we don't get the content-length, see if we have all the * buckets and use their length to calculate the size */