Skip to content

Commit

Permalink
http_protocol: make request processing more robust for incomplete data
Browse files Browse the repository at this point in the history
- Length restrictions may error on a too long request path, leaving
  the uri unset.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910533 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
icing committed Jun 21, 2023
1 parent f3004c8 commit ece6bf4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,9 +1368,16 @@ AP_DECLARE(request_rec *) ap_read_request(conn_rec *conn)
headers = breq->headers? apr_table_clone(r->pool, breq->headers) : NULL;
}

if (!method || !uri || !protocol) {
access_status = berr? ((ap_bucket_error *)(berr->data))->status :
HTTP_INTERNAL_SERVER_ERROR;
goto die_unusable_input;
}

if (headers) {
r->headers_in = headers;
}

ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
"checking request: %s %s %s",
method, uri, protocol);
Expand Down

0 comments on commit ece6bf4

Please sign in to comment.