mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-12 14:31:00 +01:00
BUG/MAJOR: http: don't emit the send-name-header when no server is available
Lukas Benes reported that http-send-name-header causes a segfault if no
server is available because we're dereferencing the session's target which
is NULL. The tiniest reproducer looks like this :
listen foo
bind :1234
mode http
http-send-name-header srv
This obvious fix must be backported to 1.4 which is affected as well.
This commit is contained in:
parent
092502605e
commit
0fc36e3ae9
@ -2202,7 +2202,7 @@ struct task *process_session(struct task *t)
|
|||||||
/* check for HTTP mode and proxy server_name_hdr_name != NULL */
|
/* check for HTTP mode and proxy server_name_hdr_name != NULL */
|
||||||
if ((s->flags & SN_BE_ASSIGNED) &&
|
if ((s->flags & SN_BE_ASSIGNED) &&
|
||||||
(s->be->mode == PR_MODE_HTTP) &&
|
(s->be->mode == PR_MODE_HTTP) &&
|
||||||
(s->be->server_id_hdr_name != NULL)) {
|
(s->be->server_id_hdr_name != NULL && s->target)) {
|
||||||
http_send_name_header(&s->txn, s->be, objt_server(s->target)->id);
|
http_send_name_header(&s->txn, s->be, objt_server(s->target)->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user