From: Willy Tarreau Date: Thu, 2 Nov 2017 16:16:07 +0000 (+0100) Subject: BUG/MAJOR: buffers: fix get_buffer_nc() for data at end of buffer X-Git-Tag: v1.8-rc2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b75fffa2bb0c60f26affe3e784956a0b8087442;p=thirdparty%2Fhaproxy.git BUG/MAJOR: buffers: fix get_buffer_nc() for data at end of buffer This function incorrectly dealt with the case where data doesn't wrap but lies at the end of the buffer, resulting in Lukas' reported data corruption with HTTP/2. No backport is needed, it was introduced for HTTP/2 in 1.8-dev. --- diff --git a/include/common/buffer.h b/include/common/buffer.h index f11d6a9621..c6fb2fea5e 100644 --- a/include/common/buffer.h +++ b/include/common/buffer.h @@ -543,7 +543,7 @@ static inline int bo_getblk_nc(struct buffer *buf, char **blk1, int *len1, char return 2; } - *blk1 = buf->p - buf->o; + *blk1 = bo_ptr(buf); *len1 = buf->o; return 1; }