From: Willy Tarreau Date: Thu, 31 May 2012 09:33:42 +0000 (+0200) Subject: BUG/MAJOR: b_rew() must pass a signed offset to b_ptr() X-Git-Tag: v1.5-dev12~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab152a7eda8b0b3d18afcd23f202c60211dff638;p=thirdparty%2Fhaproxy.git BUG/MAJOR: b_rew() must pass a signed offset to b_ptr() Commit 13e66da introduced b_rew() but passes -adv which is an unsigned quantity on 64-bit platforms, causing the buffer to advance in the wrong direction. No backport is needed. --- diff --git a/include/proto/buffers.h b/include/proto/buffers.h index 66c6e61782..80f43ae4a6 100644 --- a/include/proto/buffers.h +++ b/include/proto/buffers.h @@ -313,7 +313,7 @@ static inline void b_rew(struct buffer *b, unsigned int adv) b->o -= adv; if (!b->o && !b->pipe) b->flags |= BF_OUT_EMPTY; - b->p = b_ptr(b, -adv); + b->p = b_ptr(b, (int)-adv); } /* Return the amount of bytes that can be written into the buffer at once,