mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-11 22:11:04 +01:00
BUG/MINOR: mux-h2: Fix possible null pointer deref on h2c in _h2_trace_header()
As reported by Coverity, this function may be called with no h2c. Thus, the pointer must always be checked before any access. One test was missing in TRACE_PRINTF_LOC(). This patch should fix the issue #2015. No backport needed, except if the commit 11e8a8c2a ("MEDIUM: mux-h2/trace: add tracing support for headers") is backported.
This commit is contained in:
parent
df238c34c2
commit
c254516c53
@ -879,7 +879,7 @@ void _h2_trace_header(const struct ist hn, const struct ist hv,
|
|||||||
chunk_appendf(&trash, " (... +%ld)", (long)(hv.len - v_ist.len));
|
chunk_appendf(&trash, " (... +%ld)", (long)(hv.len - v_ist.len));
|
||||||
|
|
||||||
TRACE_PRINTF_LOC(TRACE_LEVEL_USER, mask, trc_loc, func,
|
TRACE_PRINTF_LOC(TRACE_LEVEL_USER, mask, trc_loc, func,
|
||||||
h2c->conn, 0, 0, 0,
|
(h2c ? h2c->conn : 0), 0, 0, 0,
|
||||||
"%s%s%s %s: %s", c_str, s_str,
|
"%s%s%s %s: %s", c_str, s_str,
|
||||||
(mask & H2_EV_TX_HDR) ? "sndh" : "rcvh",
|
(mask & H2_EV_TX_HDR) ? "sndh" : "rcvh",
|
||||||
n_ist.ptr, v_ist.ptr);
|
n_ist.ptr, v_ist.ptr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user