]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: http: address a couple of null-deref warnings at -Wextra
authorWilly Tarreau <w@1wt.eu>
Thu, 20 Sep 2018 09:12:58 +0000 (11:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Sep 2018 09:42:15 +0000 (11:42 +0200)
These two warnings are caused by the use of objt_server() without
checking its result. These are turned to __objt_server() which is
safe there.

src/proto_http.c

index 22eab8b30aa7f0628d114203327669876e2db74d..c17d67ca39705fa84ed6c3a853270bb7c4ed57e9 100644 (file)
@@ -500,7 +500,7 @@ void http_perform_server_redirect(struct stream *s, struct stream_interface *si)
        trash.data = strlen(HTTP_302);
        memcpy(trash.area, HTTP_302, trash.data);
 
-       srv = objt_server(s->target);
+       srv = __objt_server(s->target);
 
        /* 2: add the server's prefix */
        if (trash.data + srv->rdr_len > trash.size)
@@ -5367,7 +5367,7 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s
                        goto return_bad_resp;
 
                txn->flags &= ~TX_SCK_MASK;
-               if (objt_server(s->target)->cookie && (s->flags & SF_DIRECT))
+               if (__objt_server(s->target)->cookie && (s->flags & SF_DIRECT))
                        /* the server did not change, only the date was updated */
                        txn->flags |= TX_SCK_UPDATED;
                else