The h3c <prx_counters> member is initialized from the proxy, accessed
through the connection target. On the backend side, a server instance is
expected. Historically, a connection target could alternatively be set
to the proxy itself in specific configurations (dispatch and transparent
backends).
In practice, these cases were never usable with QUIC. However, the rest
of the HAProxy codebase is still written defensively around this case.
To remove the current ambiguity, add NULL checks before dereferencing
the <prx_counters> member in the two h3_stats.c helpers.
This must be backported up to 3.3, as this is only relevant since QUIC
backend support.
void h3_inc_err_cnt(struct h3_counters *ctrs, int error_code)
{
+ /* Only needed for dispatch/option transparent, though such connection cannot carry QUIC/H3. */
+ if (!ctrs)
+ return;
+
switch (error_code) {
case H3_ERR_NO_ERROR:
HA_ATOMIC_INC(&ctrs->h3_no_error);
void h3_inc_frame_type_cnt(struct h3_counters *ctrs, int frm_type)
{
+ /* Only needed for dispatch/option transparent, though such connection cannot carry QUIC/H3. */
+ if (!ctrs)
+ return;
+
switch (frm_type) {
case H3_FT_DATA:
HA_ATOMIC_INC(&ctrs->h3_data);