From: Amaury Denoyelle Date: Mon, 26 Jul 2021 07:59:06 +0000 (+0200) Subject: MINOR: ssl: use __objt_* variant when retrieving counters X-Git-Tag: v2.5-dev3~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bf5d41ada0aaa7b996b75e42ba1327fc7507bef;p=thirdparty%2Fhaproxy.git MINOR: ssl: use __objt_* variant when retrieving counters 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. --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index e27611572a..997ab8de49 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -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);