From 20bc42e69722bb129c62fc2450a4a6757250ee0a Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Mon, 29 Apr 2024 14:16:19 +0200 Subject: [PATCH] BUG/MINOR: stats: replace objt_* by __objt_* macros Update parse_stat_line() used during stats-file parsing. For each line, GUID is extracted first to access to the object instance. obj_type() is then invoked to retrieve the correct object type. Replace objt_* by __objt_* macros to mark its result as safe and non NULL. This should fix coverity report from github issue #2550. No need to backport. --- src/stats-file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stats-file.c b/src/stats-file.c index 2706dbff14..a41df828f4 100644 --- a/src/stats-file.c +++ b/src/stats-file.c @@ -220,7 +220,7 @@ static int parse_stat_line(struct ist line, switch (obj_type(node->obj_type)) { case OBJ_TYPE_PROXY: - px = objt_proxy(node->obj_type); + px = __objt_proxy(node->obj_type); if (domain == STFILE_DOMAIN_PX_FE) { if (!(px->cap & PR_CAP_FE)) @@ -244,7 +244,7 @@ static int parse_stat_line(struct ist line, if (domain != STFILE_DOMAIN_PX_FE) goto err; - li = objt_listener(node->obj_type); + li = __objt_listener(node->obj_type); /* Listeners counters are not allocated if 'option socket-stats' unset. */ if (!li->counters) return 0; @@ -257,7 +257,7 @@ static int parse_stat_line(struct ist line, if (domain != STFILE_DOMAIN_PX_BE) goto err; - srv = objt_server(node->obj_type); + srv = __objt_server(node->obj_type); base_off = (char *)&srv->counters; off = 1; break; -- 2.47.3