From: Christophe Jaillet Date: Sat, 10 Aug 2019 09:52:34 +0000 (+0000) Subject: Fix a signed/unsigned comparison that can never match. X-Git-Tag: 2.5.0-alpha2-ci-test-only~1933 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48d5813674ce2c9ce3f5efb20a37df3928f4e47e;p=thirdparty%2Fapache%2Fhttpd.git Fix a signed/unsigned comparison that can never match. -1 is a valid length value (for socket, pipe and cgi buckets for example) All path I've checked cast the -1 to (apr_size_t) in order for the comparison to work. So do it as well here. This has been like that in trunk since r708144, about 11 years ago, so I assume that it is not really an issue. Spotted by gcc 9.1 and -Wextra git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864868 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/core_filters.c b/server/core_filters.c index 51a17a6be72..bb02b207fab 100644 --- a/server/core_filters.c +++ b/server/core_filters.c @@ -277,7 +277,7 @@ apr_status_t ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, while ((len < readbytes) && (rv == APR_SUCCESS) && (e != APR_BRIGADE_SENTINEL(ctx->bb))) { /* Check for the availability of buckets with known length */ - if (e->length != -1) { + if (e->length != (apr_size_t)-1) { len += e->length; e = APR_BUCKET_NEXT(e); }