mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
BUG/MINOR: buffers: Fix b_slow_realign when a buffer is realign without output
When b_slow_realign is called with the <output> parameter equal to 0, the buffer's head, after the realign, must be set to 0. It was errornously set to the buffer's size, because there was no test on the value of <output>.
This commit is contained in:
parent
65e94d1ce9
commit
ad4e1a4735
@ -472,7 +472,7 @@ static inline void b_slow_realign(struct buffer *b, char *swap, size_t output)
|
||||
memcpy(b_orig(b), swap, b_data(b) - output);
|
||||
memcpy(b_wrap(b) - output, swap + b_size(b) - output, output);
|
||||
|
||||
b->head = b_size(b) - output;
|
||||
b->head = (output ? b_size(b) - output : 0);
|
||||
}
|
||||
|
||||
/* b_putchar() : tries to append char <c> at the end of buffer <b>. Supports
|
||||
|
Loading…
Reference in New Issue
Block a user