From: William A. Rowe Jr Date: Wed, 3 Aug 2016 21:40:12 +0000 (+0000) Subject: C89 fix, caught by Jacob Champion X-Git-Tag: 2.5.0-alpha~1336 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4b5efa1ac33e6eb7e36770b5ef1f51c561faa43;p=thirdparty%2Fapache%2Fhttpd.git C89 fix, caught by Jacob Champion git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755116 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/protocol.c b/server/protocol.c index 9bc0083100c..bd8c3124a0f 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -837,6 +837,8 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb /* Process an obs-fold immediately by appending it to last_field */ if ((*field == '\t') || *field == ' ') { + apr_size_t fold_len; + if (last_field == NULL) { r->status = HTTP_BAD_REQUEST; ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(03442) @@ -851,7 +853,7 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb * doing O(n) allocs and using O(n^2) space for * continuations that span many many lines. */ - apr_size_t fold_len = last_len + len + 1; /* trailing null */ + fold_len = last_len + len + 1; /* trailing null */ if (fold_len >= (apr_size_t)(r->server->limit_req_fieldsize)) { const char *field_escaped;