]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ssl: fix build warning with previous changes to ssl_sock_ctx
authorWilly Tarreau <w@1wt.eu>
Mon, 11 Apr 2022 17:47:31 +0000 (19:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 Apr 2022 17:47:31 +0000 (19:47 +0200)
Some compilers see a possible null deref after conn_get_ssl_sock_ctx()
in ssl_sock_parse_heartbeat, which cannot happen there, so let's mark
it as safe. No backport needed.

src/ssl_sock.c

index 26940dbb9511152c2d8268da688c6e634591e72b..a681e253dc77a820c39f30aa41a01deaa1f21092 100644 (file)
@@ -1713,6 +1713,7 @@ static void ssl_sock_parse_heartbeat(struct connection *conn, int write_p, int v
                const unsigned char *p = buf;
                unsigned int payload;
 
+               ALREADY_CHECKED(ctx);
                ctx->xprt_st |= SSL_SOCK_RECV_HEARTBEAT;
 
                /* Check if this is a CVE-2014-0160 exploitation attempt. */