You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2023/03/03 14:21:26 UTC

svn commit: r1908026 - in /httpd/httpd/branches/2.4.x: ./ changes-entries/ajp_invalid_number_of_headers.txt modules/proxy/ajp_header.c

Author: covener
Date: Fri Mar  3 14:21:26 2023
New Revision: 1908026

URL: http://svn.apache.org/viewvc?rev=1908026&view=rev
Log:
Merge r1906940 from trunk:

* Report an error if the AJP backend sends an invalid number of headers

Reviewed By: rpluem, covener, ylavic

Added:
    httpd/httpd/branches/2.4.x/changes-entries/ajp_invalid_number_of_headers.txt
      - copied unchanged from r1906940, httpd/httpd/trunk/changes-entries/ajp_invalid_number_of_headers.txt
Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/modules/proxy/ajp_header.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1906940

Modified: httpd/httpd/branches/2.4.x/modules/proxy/ajp_header.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/ajp_header.c?rev=1908026&r1=1908025&r2=1908026&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/ajp_header.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/ajp_header.c Fri Mar  3 14:21:26 2023
@@ -584,8 +584,15 @@ static apr_status_t ajp_unmarshal_respon
         r->headers_out = save_table;
     }
     else {
-        r->headers_out = NULL;
+        /*
+         * Reset headers, but not to NULL because things below the chain expect
+         * this to be non NULL e.g. the ap_content_length_filter.
+         */
+        r->headers_out = apr_table_make(r->pool, 1);
         num_headers = 0;
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10405)
+                "ajp_unmarshal_response: Bad number of headers");
+        return rc;
     }
 
     ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r,