]> granicus.if.org Git - apache/commitdiff
don't try to place a header field in error-notes if ap_rgetline()
authorJeff Trawick <trawick@apache.org>
Wed, 6 Feb 2002 16:19:03 +0000 (16:19 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 6 Feb 2002 16:19:03 +0000 (16:19 +0000)
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

server/protocol.c

index 6fe19668db5ea714bcf0e9c4d63de8804a4befe4..81e4fc5d8a65ab9f78d12a0fc4c391a51e46f357 100644 (file)
@@ -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;
         }