From: Christopher Faulet Date: Wed, 28 Jan 2026 14:02:20 +0000 (+0100) Subject: MINOR: buffers: Swap buffers of same size only X-Git-Tag: v3.4-dev5~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fae478dae56b193a5aef2e0964501f64697ba11d;p=thirdparty%2Fhaproxy.git MINOR: buffers: Swap buffers of same size only In b_xfer(), we now take care to swap buffers of the same size only. For now, it is always the case. But that will change. --- diff --git a/src/buf.c b/src/buf.c index afe33110b..19f38e504 100644 --- a/src/buf.c +++ b/src/buf.c @@ -348,7 +348,7 @@ size_t b_xfer(struct buffer *dst, struct buffer *src, size_t count) if (ret > count) ret = count; - else if (!b_data(dst)) { + else if (!b_data(dst) && b_size(dst) == b_size(src)) { /* zero copy is possible by just swapping buffers */ struct buffer tmp = *dst; *dst = *src;