From: Jeff Trawick Date: Tue, 19 Nov 2002 19:32:38 +0000 (+0000) Subject: bucket length parameter is apr_size_t, which isn't always signed, X-Git-Tag: 2.0.44~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bc57d1e1ed559e1bf7287417e45c27ff234ca4f;p=apache bucket length parameter is apr_size_t, which isn't always signed, so be careful when comparing with the special value -1 Submitted by: Allan Edwards Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97569 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/mod_cache.c b/modules/experimental/mod_cache.c index 93a0c60709..8906b260f9 100644 --- a/modules/experimental/mod_cache.c +++ b/modules/experimental/mod_cache.c @@ -627,7 +627,7 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in) unresolved_length = 1; continue; } - if (e->length < 0) { + if (e->length == (apr_size_t)-1) { break; } size += e->length; diff --git a/modules/http/http_core.c b/modules/http/http_core.c index d55e893aa6..63d046596f 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -167,7 +167,7 @@ static apr_status_t chunk_filter(ap_filter_t *f, apr_bucket_brigade *b) if (APR_BUCKET_IS_FLUSH(e)) { flush = e; } - else if (e->length == -1) { + else if (e->length == (apr_size_t)-1) { /* unknown amount of data (e.g. a pipe) */ const char *data; apr_size_t len; diff --git a/server/protocol.c b/server/protocol.c index e92ff2be68..baf8bded66 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -1236,7 +1236,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter( eos = 1; break; } - if (e->length == -1) { + if (e->length == (apr_size_t)-1) { apr_size_t len; const char *ignored; apr_status_t rv;