]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: h2: mark the start line already checked to avoid warnings
authorWilly Tarreau <w@1wt.eu>
Sat, 8 Dec 2018 14:30:46 +0000 (15:30 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 8 Dec 2018 14:31:57 +0000 (15:31 +0100)
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

index b0b891a0799b4e91580ad111002d402fc32e0478..49303a5f238a808155e18f3f057a84f5c338856e 100644 (file)
@@ -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);