]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream: Don't use input buffer after the ownership xfer
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Dec 2020 16:22:49 +0000 (17:22 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Dec 2020 16:22:50 +0000 (17:22 +0100)
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.

src/stream.c

index 14138f066927a175dd92eb0ed4f06a60ca3819fa..690fe3e5afeee4520be419251801828e962a7b6d 100644 (file)
@@ -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);
        }