Don't use broken http_host pointer for debugging.
This circumvents a crash but is not a final fix as the reason fo the crash hasn't been found yet. git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@48 152afb58-edef-0310-8abb-c4023f1b3aa9svn/tags/release-1.3.12
parent
47ca38938d
commit
6a822b673e
|
@ -87,7 +87,7 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
|
|||
|
||||
/* scan from the right and skip the \0 */
|
||||
for (i = host_len - 1; i + 1 > 0; i--) {
|
||||
char c = host->ptr[i];
|
||||
const char c = host->ptr[i];
|
||||
|
||||
switch (stage) {
|
||||
case TOPLABEL:
|
||||
|
@ -850,6 +850,11 @@ int http_request_parse(server *srv, connection *con) {
|
|||
con->keep_alive = 0;
|
||||
|
||||
log_error_write(srv, __FILE__, __LINE__, "s", "HTTP/1.1 but Host missing -> 400");
|
||||
if (srv->srvconf.log_request_header_on_error) {
|
||||
log_error_write(srv, __FILE__, __LINE__, "Sb",
|
||||
"request-header:\n",
|
||||
con->request.request);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
@ -866,9 +871,15 @@ int http_request_parse(server *srv, connection *con) {
|
|||
/* check hostname field if it is set */
|
||||
if (NULL != con->request.http_host &&
|
||||
0 != request_check_hostname(srv, con, con->request.http_host)) {
|
||||
log_error_write(srv, __FILE__, __LINE__, "sbs",
|
||||
"Invalid Hostname:", con->request.http_host, "-> 400");
|
||||
log_error_write(srv, __FILE__, __LINE__, "s",
|
||||
"Invalid Hostname -> 400");
|
||||
|
||||
if (srv->srvconf.log_request_header_on_error) {
|
||||
log_error_write(srv, __FILE__, __LINE__, "Sb",
|
||||
"request-header:\n",
|
||||
con->request.request);
|
||||
}
|
||||
|
||||
con->http_status = 400;
|
||||
con->response.keep_alive = 0;
|
||||
con->keep_alive = 0;
|
||||
|
|
Loading…
Reference in New Issue