mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-09 23:39:55 +00:00
BUG/MAJOR: servers: Use the list api correctly to avoid crashes.
In connect_server(), if we looked for an usable connection and failed to find one, srv_conn won't be NULL at the end of list_for_each_entry(), but will point to the head of a list, which is not a pointer to a struct connection, so explicitely set it to NULL. This should be backported to 1.9.
This commit is contained in:
parent
134a2045bb
commit
c3fa638b4c
@ -1147,7 +1147,8 @@ int connect_server(struct stream *s)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!srv_conn) {
|
||||
if (reuse == 0) {
|
||||
srv_conn = NULL;
|
||||
for (i = 0; i < MAX_SRV_LIST; i++) {
|
||||
if (!LIST_ISEMPTY(&s->sess->srv_list[i].list)) {
|
||||
srv_conn = LIST_ELEM(&s->sess->srv_list[i].list,
|
||||
|
Loading…
Reference in New Issue
Block a user