mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
MINOR: http: check the source address via conn_get_src() in sample fetch functions
In smp_fetch_url32_src() and smp_fetch_base32_src() it's better to validate that the source address was properly initialized since it will soon be dynamic, thus let's call conn_get_src().
This commit is contained in:
parent
428d8e32f4
commit
cd7ca79e6c
@ -1079,7 +1079,7 @@ static int smp_fetch_base32_src(const struct arg *args, struct sample *smp, cons
|
|||||||
struct buffer *temp;
|
struct buffer *temp;
|
||||||
struct connection *cli_conn = objt_conn(smp->sess->origin);
|
struct connection *cli_conn = objt_conn(smp->sess->origin);
|
||||||
|
|
||||||
if (!cli_conn)
|
if (!cli_conn || !conn_get_src(cli_conn))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!smp_fetch_base32(args, smp, kw, private))
|
if (!smp_fetch_base32(args, smp, kw, private))
|
||||||
@ -1784,7 +1784,7 @@ static int smp_fetch_url32_src(const struct arg *args, struct sample *smp, const
|
|||||||
struct buffer *temp;
|
struct buffer *temp;
|
||||||
struct connection *cli_conn = objt_conn(smp->sess->origin);
|
struct connection *cli_conn = objt_conn(smp->sess->origin);
|
||||||
|
|
||||||
if (!cli_conn)
|
if (!cli_conn || !conn_get_src(cli_conn))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!smp_fetch_url32(args, smp, kw, private))
|
if (!smp_fetch_url32(args, smp, kw, private))
|
||||||
|
Loading…
Reference in New Issue
Block a user