projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eeb4d85
)
DEBUG: buffer: check in __b_put_blk() whether the buffer room is respected
author
Willy Tarreau
<w@1wt.eu>
Fri, 18 Feb 2022 16:33:27 +0000
(17:33 +0100)
committer
Willy Tarreau
<w@1wt.eu>
Fri, 18 Feb 2022 16:36:31 +0000
(17:36 +0100)
This adds a BUG_ON() to make sure we don't face other situations like the
one fixed by previous commit.
(cherry picked from commit
d439a496550ba44ceae09a59c72c278163ff8b99
)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/buf.h
patch
|
blob
|
history
diff --git
a/include/haproxy/buf.h
b/include/haproxy/buf.h
index
78409c0
..
de359f5
100644
(file)
--- a/
include/haproxy/buf.h
+++ b/
include/haproxy/buf.h
@@
-519,6
+519,8
@@
static inline void __b_putblk(struct buffer *b, const char *blk, size_t len)
{
size_t half = b_contig_space(b);
+ BUG_ON(b_data(b) + len > b_size(b));
+
if (half > len)
half = len;