]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h1: don't try to process an empty input buffer
authorWilly Tarreau <w@1wt.eu>
Sun, 16 Dec 2018 07:29:56 +0000 (08:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 16 Dec 2018 07:29:56 +0000 (08:29 +0100)
h1_process_input() may occasionally be called with an empty input
buffer, and the code behind cannot deal with that, let's check the
condition at the beginning.

No backport is needed.

src/mux_h1.c

index 45d24c1836b9eee88641c1d731cb83eb9db6ba87..4e884ed8f37ea59742078fc5ab396570dd11b25a 100644 (file)
@@ -1278,6 +1278,9 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, int flags)
        if (count > max)
                count = max;
 
+       if (!count)
+               goto end;
+
        if (!conn_is_back(h1c->conn)) {
                h1m = &h1s->req;
                errflag = H1S_F_REQ_ERROR;