From: Christopher Faulet Date: Fri, 4 Dec 2020 16:22:49 +0000 (+0100) Subject: BUG/MINOR: stream: Don't use input buffer after the ownership xfer X-Git-Tag: v2.4-dev3~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c43fca01390c4563dfe1d31ace7f1e9b64d9750c;p=thirdparty%2Fhaproxy.git BUG/MINOR: stream: Don't use input buffer after the ownership xfer At the end of stream_new(), once the input buffer is transfer to the request channel, it must not be used anymore. The previous patch (16df178b6 "BUG/MEDIUM: stream: Xfer the input buffer to a fully created stream") was pushed to quickly. No backport needed. --- diff --git a/src/stream.c b/src/stream.c index 14138f0669..690fe3e5af 100644 --- a/src/stream.c +++ b/src/stream.c @@ -526,7 +526,7 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin, struct bu */ s->req.buf = *input; *input = BUF_NULL; - s->req.total = (IS_HTX_STRM(s) ? htxbuf(input)->data : b_data(input)); + s->req.total = (IS_HTX_STRM(s) ? htxbuf(&s->req.buf)->data : b_data(&s->req.buf)); s->req.flags |= (s->req.total ? CF_READ_PARTIAL : 0); }