diff --git a/include/haproxy/htx.h b/include/haproxy/htx.h index b6d95274e..a6535237b 100644 --- a/include/haproxy/htx.h +++ b/include/haproxy/htx.h @@ -466,7 +466,9 @@ static inline struct htx_blk *htx_add_header(struct htx *htx, const struct ist n { struct htx_blk *blk; - /* FIXME: check name.len (< 256B) and value.len (< 1MB) */ + if (name.len > 255 || value.len > 1048575) + return NULL; + blk = htx_add_blk(htx, HTX_BLK_HDR, name.len + value.len); if (!blk) return NULL; @@ -485,7 +487,9 @@ static inline struct htx_blk *htx_add_trailer(struct htx *htx, const struct ist { struct htx_blk *blk; - /* FIXME: check name.len (< 256B) and value.len (< 1MB) */ + if (name.len > 255 || value.len > 1048575) + return NULL; + blk = htx_add_blk(htx, HTX_BLK_TLR, name.len + value.len); if (!blk) return NULL;