From e2778a43d4e88d71a0e06030c64e9bfbbd1a0d57 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 8 Dec 2018 15:30:46 +0100 Subject: [PATCH] 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. --- src/mux_h2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mux_h2.c b/src/mux_h2.c index b0b891a07..49303a5f2 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);