]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Restore single-char field names inadvertantly disallowed in 2.4.25.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 29 Jun 2017 00:16:37 +0000 (00:16 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 29 Jun 2017 00:16:37 +0000 (00:16 +0000)
Backports: r1800173
PR: 61220
Submitted by: ylavic
Reviewed by: wrowe, jchampion, ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1800216 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
server/protocol.c

diff --git a/CHANGES b/CHANGES
index 9ace7aefa56dffbadf7a5d21ab08ebac122e8c8b..e8d9f4ed8af8dc960855523792e94d469192dc0c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.34
 
-
+  *) Allow single-char field names inadvertantly disallowed in 2.2.32.
+     PR 61220. [Yann Ylavic]
 
 Changes with Apache 2.2.33
 
diff --git a/STATUS b/STATUS
index 9b5049feffa769d8fdb2e0fea9305d6171044dc7..4f84c83516916b844348051c1e12c0e6b5eaf407 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -104,14 +104,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   *) Restore single-char field names inadvertantly disallowed in 2.4.25.
-      Backports: r1800173
-      PR: 61220
-      Submitted by: ylavic
-      trunk patch: http://svn.apache.org/r1800173 (plus CHANGES)
-      2.2.x patch: https://home.apache.org/~jchampion/patches/2.2.x-allow-single-char-headers.patch
-      +1: wrowe, jchampion, ylavic
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 2705bba812fc6dabd2a889acfd345bebf173dee1..489e91a8fdc2dd3e693201f556cb767d87973de7 100644 (file)
@@ -1081,8 +1081,12 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb
                     return;
                 }
 
-                /* last character of field-name */
-                tmp_field = value - (value > last_field ? 1 : 0);
+                if (value == last_field) {
+                    r->status = HTTP_BAD_REQUEST;
+                    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+                                  "Request header field name was empty");
+                    return;
+                }
 
                 *value++ = '\0'; /* NUL-terminate at colon */
 
@@ -1105,13 +1109,6 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb
                                   " bad whitespace");
                     return;
                 }
-
-                if (tmp_field == last_field) {
-                    r->status = HTTP_BAD_REQUEST;
-                    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
-                                  "Request header field name was empty");
-                    return;
-                }
             }
             else /* Using strict RFC7230 parsing */
             {