]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: properly abort on trailers decoding errors
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2019 09:26:47 +0000 (10:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2019 14:27:06 +0000 (15:27 +0100)
There was an incomplete test in h2c_frt_handle_headers() resulting
in negative return values from h2c_decode_headers() not being taken
as errors. The effect is that the stream is then aborted on timeout
only.

This fix must be backported to 1.9.

src/mux_h2.c

index 47f0e8cc319b278006035862da0f5a16aec5eb1c..4e128d038845528f7a1710a11df57a5a77c89ec8 100644 (file)
@@ -1865,7 +1865,7 @@ static struct h2s *h2c_frt_handle_headers(struct h2c *h2c, struct h2s *h2s)
        if (h2s->st != H2_SS_IDLE) {
                /* The stream exists/existed, this must be a trailers frame */
                if (h2s->st != H2_SS_CLOSED) {
-                       if (!h2c_decode_headers(h2c, &h2s->rxbuf, &h2s->flags))
+                       if (h2c_decode_headers(h2c, &h2s->rxbuf, &h2s->flags) <= 0)
                                goto out;
                        goto done;
                }