From: Willy Tarreau Date: Sat, 8 Dec 2018 14:30:46 +0000 (+0100) Subject: BUILD: h2: mark the start line already checked to avoid warnings X-Git-Tag: v1.9-dev10~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2778a43d4e88d71a0e06030c64e9bfbbd1a0d57;p=thirdparty%2Fhaproxy.git BUILD: h2: mark the start line already checked to avoid warnings Gcc 7 warns about a potential null pointer deref that cannot happen since the start line block is guaranteed to be present in the functions where it's dereferenced. Let's mark it as already checked. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index b0b891a079..49303a5f23 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -3822,6 +3822,7 @@ static size_t h2s_htx_frt_make_resp_headers(struct h2s *h2s, struct htx *htx) /* get the start line, we do have one */ sl = htx_get_stline(htx); + ALREADY_CHECKED(sl); h2s->status = sl->info.res.status; /* and the rest of the headers, that we dump starting at header 0 */ @@ -4035,6 +4036,7 @@ static size_t h2s_htx_bck_make_req_headers(struct h2s *h2s, struct htx *htx) /* get the start line, we do have one */ sl = htx_get_stline(htx); + ALREADY_CHECKED(sl); meth = htx_sl_req_meth(sl); path = htx_sl_req_uri(sl);