From 941c2a41cb8bdbb0b2edf838c0c564677a51f819 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 24 Jul 2002 20:47:28 +0000 Subject: [PATCH] Replace atol() calls which should return long long with apr_atoll() calls. Submitted by: Shantonu Sen git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96179 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ modules/dav/main/mod_dav.c | 9 ++++----- modules/experimental/mod_cache.c | 2 +- modules/http/http_protocol.c | 6 +++--- modules/mappers/mod_negotiation.c | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 004e1d8ce1..c48c9a8a39 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0.40 + *) Replace usage of atol() to parse strings when we might want a + larger-than-long value with apr_atoll(), which returns long long. + This allows HTTPD to deal with larger files correctly. + [Shantonu Sen ] + *) mod_ext_filter: Ignore any content-type parameters when checking if the response should be filtered. Previously, "intype=text/html" wouldn't match something like "text/html;charset=8859_1". diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 81fef1bb4d..7ec2b0bde3 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -761,12 +761,11 @@ static int dav_parse_range(request_rec *r, *dash = *slash = '\0'; - /* ### atol may not be large enough for the apr_off_t */ - *range_start = atol(range + 6); - *range_end = atol(dash + 1); + *range_start = apr_atoll(range + 6); + *range_end = apr_atoll(dash + 1); if (*range_end < *range_start - || (slash[1] != '*' && atol(slash + 1) <= *range_end)) { + || (slash[1] != '*' && apr_atoll(slash + 1) <= *range_end)) { /* invalid range. ignore it (per S14.16 of RFC2616) */ return 0; } @@ -2319,7 +2318,7 @@ static int process_mkcol_body(request_rec *r) return HTTP_BAD_REQUEST; } - r->remaining = atol(lenp); + r->remaining = apr_atoll(lenp); } if (r->read_chunked || r->remaining > 0) { diff --git a/modules/experimental/mod_cache.c b/modules/experimental/mod_cache.c index 65329276f7..ced7cf3290 100644 --- a/modules/experimental/mod_cache.c +++ b/modules/experimental/mod_cache.c @@ -577,7 +577,7 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in) const char* cl; cl = apr_table_get(r->headers_out, "Content-Length"); if (cl) { - size = atol(cl); + size = apr_atoll(cl); } else { diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index c34df22407..92b3db42e7 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2719,15 +2719,15 @@ static int parse_byterange(char *range, apr_off_t clength, if ((dash == range)) { /* In the form "-5" */ - *start = clength - atol(dash + 1); + *start = clength - apr_atoll(dash + 1); *end = clength - 1; } else { *dash = '\0'; dash++; - *start = atol(range); + *start = apr_atoll(range); if (*dash) { - *end = atol(dash); + *end = apr_atoll(dash); } else { /* "5-" */ *end = clength - 1; diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 1912e96e77..efc9b94b64 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -948,7 +948,7 @@ static int read_type_map(apr_file_t **map, negotiation_state *neg, request_rec * has_content = 1; } else if (!strncmp(buffer, "content-length:", 15)) { - mime_info.bytes = atol(body); + mime_info.bytes = apr_atoll((char *)body); has_content = 1; } else if (!strncmp(buffer, "content-language:", 17)) { -- 2.40.0