]> granicus.if.org Git - apache/commitdiff
prevent a potential seg fault in ap_escape_html if a header field is too
authorGreg Ames <gregames@apache.org>
Tue, 10 Dec 2002 02:56:26 +0000 (02:56 +0000)
committerGreg Ames <gregames@apache.org>
Tue, 10 Dec 2002 02:56:26 +0000 (02:56 +0000)
long.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97832 13f79535-47bb-0310-9956-ffa450edef68

server/protocol.c

index b683f022115bf7c029101632a4e2fd6870a2bc5e..d1fbba3c52e39464c2f27614954fd635171d8450 100644 (file)
@@ -778,6 +778,8 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb
             || (rv == APR_SUCCESS 
                 && len > (apr_size_t)r->server->limit_req_fieldsize)) {
             r->status = HTTP_BAD_REQUEST;
+            /* insure ap_escape_html will terminate correctly */
+            field[r->server->limit_req_fieldsize] = '\0';
             apr_table_setn(r->notes, "error-notes",
                            apr_pstrcat(r->pool,
                                        "Size of a request header field "