]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Always initilize h1m variable in h1_process_input()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 Feb 2019 13:45:05 +0000 (14:45 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 Feb 2019 13:51:17 +0000 (14:51 +0100)
It is used at the end of the function to know if the end of the message was
reached. So we must be sure to always initialize it.

This patch must be backported to 1.9.

src/mux_h1.c

index a88722c6d2f1131d00c654dfdb29400c0cb8eab6..59784051ea9fa766e2175f0a36be565ebb02d33e 100644 (file)
@@ -1323,11 +1323,6 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, int flags)
        int errflag;
 
        htx = htx_from_buf(buf);
-       data = htx->data;
-       count = b_data(&h1c->ibuf);
-       if (!count)
-               goto end;
-       rsv = ((flags & CO_RFL_KEEP_RSV) ? global.tune.maxrewrite : 0);
 
        if (!conn_is_back(h1c->conn)) {
                h1m = &h1s->req;
@@ -1338,6 +1333,12 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, int flags)
                errflag = H1S_F_RES_ERROR;
        }
 
+       data = htx->data;
+       count = b_data(&h1c->ibuf);
+       if (!count)
+               goto end;
+       rsv = ((flags & CO_RFL_KEEP_RSV) ? global.tune.maxrewrite : 0);
+
        do {
                if (h1m->state <= H1_MSG_LAST_LF) {
                        ret = h1_process_headers(h1s, h1m, htx, &h1c->ibuf, &total, count);