From: Willy Tarreau Date: Wed, 12 Sep 2018 07:05:16 +0000 (+0200) Subject: MINOR: h2: make sure h1m->err_pos field is correct on chunk error X-Git-Tag: v1.9-dev2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25173a7bcce8173c294c9f15ca7e6da8bc8415e0;p=thirdparty%2Fhaproxy.git MINOR: h2: make sure h1m->err_pos field is correct on chunk error This never happens but in case it would, it's better to report the correct offset of the error instead of a negative value. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index c1dad4c556..4da20070f7 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -3316,7 +3316,7 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, const struct buffer *buf, if (ret < 0) { /* FIXME: bad contents. how to proceed here when we're in H2 ? */ - h1m->err_pos = ret; + h1m->err_pos = ofs + max + ret; h2s_error(h2s, H2_ERR_INTERNAL_ERROR); goto end; } @@ -3334,7 +3334,7 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, const struct buffer *buf, if (ret < 0) { /* FIXME: bad contents. how to proceed here when we're in H2 ? */ - h1m->err_pos = ret; + h1m->err_pos = ofs + max + ret; h2s_error(h2s, H2_ERR_INTERNAL_ERROR); goto end; }