mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-20 12:40:46 +00:00
BUG/MEDIUM: buffers: Make sure we don't wrap in ci_insert_line2/b_rep_blk.
In ci_insert_line2() and b_rep_blk(), we can't afford to wrap, so don't use b_tail() to check if we do, use __b_tail() instead. This should be backported to previous versions.
This commit is contained in:
parent
747ca61693
commit
363c745569
@ -578,7 +578,7 @@ static inline int b_rep_blk(struct buffer *b, char *pos, char *end, const char *
|
||||
|
||||
delta = len - (end - pos);
|
||||
|
||||
if (b_tail(b) + delta > b_wrap(b))
|
||||
if (__b_tail(b) + delta > b_wrap(b))
|
||||
return 0; /* no space left */
|
||||
|
||||
if (b_data(b) &&
|
||||
|
@ -417,7 +417,7 @@ int ci_insert_line2(struct channel *c, int pos, const char *str, int len)
|
||||
|
||||
delta = len + 2;
|
||||
|
||||
if (b_tail(b) + delta >= b_wrap(b))
|
||||
if (__b_tail(b) + delta >= b_wrap(b))
|
||||
return 0; /* no space left */
|
||||
|
||||
if (b_data(b) &&
|
||||
|
Loading…
Reference in New Issue
Block a user