]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: use __objt_* variant when retrieving counters
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 26 Jul 2021 07:59:06 +0000 (09:59 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 26 Jul 2021 07:59:06 +0000 (09:59 +0200)
Use non-checked function to retrieve listener/server via obj_type. This
is done as a previous obj_type function ensure that the type is well
known and the instance is not NULL.

Incidentally, this should prevent the coverity report from the #1335
github issue which warns about a possible NULL dereference.

src/ssl_sock.c

index e27611572afa566842963df7d052270da8284614..997ab8de498a2d5157e79366614b78600d49334e 100644 (file)
@@ -5389,14 +5389,14 @@ static int ssl_sock_handshake(struct connection *conn, unsigned int flag)
        /* get counters */
        switch (obj_type(conn->target)) {
        case OBJ_TYPE_LISTENER:
-               li = objt_listener(conn->target);
+               li = __objt_listener(conn->target);
                counters = EXTRA_COUNTERS_GET(li->extra_counters, &ssl_stats_module);
                counters_px = EXTRA_COUNTERS_GET(li->bind_conf->frontend->extra_counters_fe,
                                                 &ssl_stats_module);
                break;
 
        case OBJ_TYPE_SERVER:
-               srv = objt_server(conn->target);
+               srv = __objt_server(conn->target);
                counters = EXTRA_COUNTERS_GET(srv->extra_counters, &ssl_stats_module);
                counters_px = EXTRA_COUNTERS_GET(srv->proxy->extra_counters_be,
                                                 &ssl_stats_module);