]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
core: Follow up to r1664205.
authorYann Ylavic <ylavic@apache.org>
Fri, 6 Mar 2015 09:55:16 +0000 (09:55 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 6 Mar 2015 09:55:16 +0000 (09:55 +0000)
Don't let invalid r->proto_num/protocol out of read_request_line() reach
the output filters (when responding with 400 Bad Request).
Suggested by: rpluem

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

server/protocol.c

index cfa625a5199097d108187f004eec8ff9a20d93c6..9c05108ada6253c43c0d258fa6890ffcc26a9fdf 100644 (file)
@@ -674,6 +674,9 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02418)
                           "Invalid protocol '%s'", r->protocol);
             if (enforce_strict) {
+                r->proto_num = HTTP_VERSION(1,0);
+                r->protocol  = apr_pstrdup(r->pool, "HTTP/1.0");
+                r->connection->keepalive = AP_CONN_CLOSE;
                 r->status = HTTP_BAD_REQUEST;
                 return 0;
             }