From: Christopher Faulet Date: Tue, 27 Apr 2021 09:29:00 +0000 (+0200) Subject: MINOR: htx: Limit length of headers name/value when a HTX message is dumped X-Git-Tag: v2.4-dev18~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=260ec8e9a9182a2696df4183ccb1920397d8e528;p=thirdparty%2Fhaproxy.git MINOR: htx: Limit length of headers name/value when a HTX message is dumped In htx_dump() function, we now limit the length of the headers name and the value to not fully print huge headers. --- diff --git a/include/haproxy/htx.h b/include/haproxy/htx.h index ce6b7853f8..7de316e333 100644 --- a/include/haproxy/htx.h +++ b/include/haproxy/htx.h @@ -805,8 +805,8 @@ static inline void htx_dump(struct buffer *chunk, const struct htx *htx, int ful else if (type == HTX_BLK_HDR || type == HTX_BLK_TLR) chunk_appendf(chunk, "\t\t[%u] type=%-17s - size=%-6u - addr=%-6u\t%.*s: %.*s\n", pos, htx_blk_type_str(type), sz, blk->addr, - (int)n.len, n.ptr, - (int)v.len, v.ptr); + (int)MIN(n.len, 32), n.ptr, + (int)MIN(v.len, 64), v.ptr); else chunk_appendf(chunk, "\t\t[%u] type=%-17s - size=%-6u - addr=%-6u%s\n", pos, htx_blk_type_str(type), sz, blk->addr,