BUG/MINOR: httpclient: return NULL when no proxy available during httpclient_new()
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 17 Oct 2024 09:57:29 +0000 (11:57 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 17 Oct 2024 09:57:29 +0000 (11:57 +0200)
commite7b7072943d658702eba3651d66c6093f1a79fa8
tree64e82230d9e2bcb0f0d14c34911874db04e3cd97
parent1fb61475f2cdc54945a2effa08409b27d0ac3006
BUG/MINOR: httpclient: return NULL when no proxy available during httpclient_new()

Latest patches on the mworker rework skipped the httpclient_proxy
creation by accident. This is not supposed to happen because haproxy is
supposed to stop when the proxy creation failed, but it shows a flaw in
the API.

When the httpclient_proxy or the proxy used in parameter of
httpclient_new_from_proxy() is NULL, it will be dereferenced and cause a
crash.

The patch only returns a NULL when doing an httpclient_new() if the
proxy is not available.

Must be backported as far as 2.7.
src/http_client.c