]> granicus.if.org Git - apache/commitdiff
Restore single-char field names inadvertantly disallowed in 2.4.25.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 28 Jun 2017 14:15:28 +0000 (14:15 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 28 Jun 2017 14:15:28 +0000 (14:15 +0000)
PR: 61220
Submitted by: ylavic

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

server/protocol.c

index e659135c211b4a5c5f78ff7e1a38517eed925edd..6894e23d8b521fd0c2da270600182f6ee55654c7 100644 (file)
@@ -1086,8 +1086,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, APLOGNO(03453)
+                                  "Request header field name was empty");
+                    return;
+                }
 
                 *value++ = '\0'; /* NUL-terminate at colon */
 
@@ -1110,13 +1114,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, APLOGNO(03453)
-                                  "Request header field name was empty");
-                    return;
-                }
             }
             else /* Using strict RFC7230 parsing */
             {