From: Jeff Trawick Date: Wed, 6 Feb 2002 16:19:03 +0000 (+0000) Subject: don't try to place a header field in error-notes if ap_rgetline() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d580c767f4282a1288bc84e135e8bdf54a913a75;p=apache don't try to place a header field in error-notes if ap_rgetline() returned something like APR_EOF, since len is not set in this case and we can go off the end of storage make sure we set r->status to something when we bail out due to an error; otherwise, the request goes forward with meaningless headers git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93294 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/protocol.c b/server/protocol.c index 6fe19668db..81e4fc5d8a 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -691,7 +691,8 @@ static void get_mime_headers(request_rec *r) * finding the end-of-line. This is only going to happen if it * exceeds the configured limit for a field size. */ - if (rv == APR_ENOSPC || len > r->server->limit_req_fieldsize) { + if (rv == APR_ENOSPC || + (rv == APR_SUCCESS && len > r->server->limit_req_fieldsize)) { r->status = HTTP_BAD_REQUEST; apr_table_setn(r->notes, "error-notes", apr_pstrcat(r->pool, @@ -704,6 +705,7 @@ static void get_mime_headers(request_rec *r) } if (rv != APR_SUCCESS) { + r->status = HTTP_BAD_REQUEST; ap_log_rerror(APLOG_MARK, APLOG_NOTICE, rv, r, "get_mime_headers() failed"); return; }