diff options
| author | Arno Töll <arno@debian.org> | 2012-10-20 02:58:14 +0200 |
|---|---|---|
| committer | Arno Töll <arno@debian.org> | 2012-10-20 02:58:14 +0200 |
| commit | 5c4fba3ffbe778bdffe10a93d04821579601a020 (patch) | |
| tree | 91be9a7f99d3988ba48b0a619479aa46a3234191 /server/protocol.c | |
| parent | 8f9c15530d0bc387af114619b3ff3f930eb23d3c (diff) | |
| download | apache2-upstream/2.4.3.tar.gz | |
Imported Upstream version 2.4.3upstream/2.4.3
Diffstat (limited to 'server/protocol.c')
| -rw-r--r-- | server/protocol.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/server/protocol.c b/server/protocol.c index 4fcff4da..30b3cd5e 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -746,19 +746,29 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb * 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 && field) { - /* ensure ap_escape_html will terminate correctly */ - field[len - 1] = '\0'; + if (rv == APR_ENOSPC) { + const char *field_escaped; + if (field) { + /* ensure ap_escape_html will terminate correctly */ + field[len - 1] = '\0'; + field_escaped = ap_escape_html(r->pool, field); + } + else { + field_escaped = field = ""; + } + apr_table_setn(r->notes, "error-notes", apr_psprintf(r->pool, "Size of a request header field " "exceeds server limit.<br />\n" "<pre>\n%.*s\n</pre>\n", - field_name_len(field), - ap_escape_html(r->pool, field))); + field_name_len(field_escaped), + field_escaped)); ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00561) - "Request header exceeds LimitRequestFieldSize: " - "%.*s", field_name_len(field), field); + "Request header exceeds LimitRequestFieldSize%s" + "%.*s", + *field ? ": " : "", + field_name_len(field), field); } return; } |
