You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2017/06/28 14:15:28 UTC
svn commit: r1800173 - /httpd/httpd/trunk/server/protocol.c
Author: wrowe
Date: Wed Jun 28 14:15:28 2017
New Revision: 1800173
URL: http://svn.apache.org/viewvc?rev=1800173&view=rev
Log:
Restore single-char field names inadvertantly disallowed in 2.4.25.
PR: 61220
Submitted by: ylavic
Modified:
httpd/httpd/trunk/server/protocol.c
Modified: httpd/httpd/trunk/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/protocol.c?rev=1800173&r1=1800172&r2=1800173&view=diff
==============================================================================
--- httpd/httpd/trunk/server/protocol.c (original)
+++ httpd/httpd/trunk/server/protocol.c Wed Jun 28 14:15:28 2017
@@ -1086,8 +1086,12 @@ AP_DECLARE(void) ap_get_mime_headers_cor
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_cor
" 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 */
{