]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: htx: Limit length of headers name/value when a HTX message is dumped
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 Apr 2021 09:29:00 +0000 (11:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Apr 2021 08:51:08 +0000 (10:51 +0200)
In htx_dump() function, we now limit the length of the headers name and the
value to not fully print huge headers.

include/haproxy/htx.h

index ce6b7853f8ebee53da8eadc583eb0eeebd15c042..7de316e333b8b3de191925007b0d28bab99809b9 100644 (file)
@@ -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,