mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
BUG/MEDIUM: send_proxy: fix initialisation of send_proxy_ofs
Commit b22e55bc
introduced send_proxy_ofs but forgot to initialize it,
which remained unnoticed since it's always at the same place in the
stream interface. On a machine with dirty RAM returned by malloc(),
some responses were holding a PROXY header, which normally is not
possible.
The problem goes away after properly initializing the field upon each
new session_accept().
This fix does not need to be backported except if any code makes use of
a backport of this feature.
This commit is contained in:
parent
515393649c
commit
63e7fe310e
@ -1156,6 +1156,7 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
|
||||
s->si[0].err_loc = NULL;
|
||||
s->si[0].proto = NULL;
|
||||
s->si[0].release = NULL;
|
||||
s->si[0].send_proxy_ofs = 0;
|
||||
clear_target(&s->si[0].target);
|
||||
s->si[0].exp = TICK_ETERNITY;
|
||||
s->si[0].flags = SI_FL_NONE;
|
||||
@ -1174,6 +1175,7 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
|
||||
s->si[1].err_loc = NULL;
|
||||
s->si[1].proto = peer->proto;
|
||||
s->si[1].release = NULL;
|
||||
s->si[1].send_proxy_ofs = 0;
|
||||
set_target_proxy(&s->si[1].target, s->be);
|
||||
s->si[1].exp = TICK_ETERNITY;
|
||||
s->si[1].flags = SI_FL_NONE;
|
||||
|
@ -171,6 +171,7 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
||||
s->si[0].err_loc = NULL;
|
||||
s->si[0].proto = l->proto;
|
||||
s->si[0].release = NULL;
|
||||
s->si[0].send_proxy_ofs = 0;
|
||||
clear_target(&s->si[0].target);
|
||||
s->si[0].exp = TICK_ETERNITY;
|
||||
s->si[0].flags = SI_FL_NONE;
|
||||
@ -195,6 +196,7 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
||||
s->si[1].err_loc = NULL;
|
||||
s->si[1].proto = NULL;
|
||||
s->si[1].release = NULL;
|
||||
s->si[1].send_proxy_ofs = 0;
|
||||
clear_target(&s->si[1].target);
|
||||
s->si[1].sock.shutr= stream_int_shutr;
|
||||
s->si[1].sock.shutw= stream_int_shutw;
|
||||
|
Loading…
Reference in New Issue
Block a user