commit | d439a496550ba44ceae09a59c72c278163ff8b99 | [log] [tgz] |
---|---|---|
author | Willy Tarreau <w@1wt.eu> | Fri Feb 18 17:33:27 2022 +0100 |
committer | Willy Tarreau <w@1wt.eu> | Fri Feb 18 17:33:27 2022 +0100 |
tree | d06007443dd5e4082054b4790343d4d0d8da4465 | |
parent | 11adb1d8fcab29ef8b12c93e3b036bb3dcf1607b [diff] |
DEBUG: buffer: check in __b_put_blk() whether the buffer room is respected This adds a BUG_ON() to make sure we don't face other situations like the one fixed by previous commit.
diff --git a/include/haproxy/buf.h b/include/haproxy/buf.h index 78409c0..de359f5 100644 --- a/include/haproxy/buf.h +++ b/include/haproxy/buf.h
@@ -519,6 +519,8 @@ { size_t half = b_contig_space(b); + BUG_ON(b_data(b) + len > b_size(b)); + if (half > len) half = len;