From 081e62e748e01e5d749906f94cd7547e26f44e34 Mon Sep 17 00:00:00 2001 From: Alexander A Oganezov Date: Fri, 23 Aug 2024 07:49:46 +0000 Subject: [PATCH 1/2] DAOS-16407 cart: coverity 2555825 fix - Added explicit assert check for provider_str not being null and removed a conditional check which confused coverity. Required-githooks: true Signed-off-by: Alexander A Oganezov --- src/cart/crt_hg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cart/crt_hg.c b/src/cart/crt_hg.c index c1d1b3a3f9b..789d75ceb31 100644 --- a/src/cart/crt_hg.c +++ b/src/cart/crt_hg.c @@ -672,6 +672,8 @@ crt_get_info_string(bool primary, crt_provider_t provider, int iface_idx, start_port = crt_provider_ctx0_port_get(primary, provider); domain_str = crt_provider_domain_str_get(primary, provider, iface_idx); + D_ASSERTF(provider_str != NULL, "String for provider=%d not found\n", provider); + /* CXI provider uses domain names for info string */ if (provider == CRT_PROV_OFI_CXI) iface_str = NULL; @@ -690,8 +692,7 @@ crt_get_info_string(bool primary, crt_provider_t provider, int iface_idx, D_GOTO(out, rc); } - if (provider_str) - size += strlen(provider_str); + size = strlen(provider_str); if (domain_str) size += strlen(domain_str); if (iface_str) From c8db19b09afb2f00d0950278e46ae9f411638345 Mon Sep 17 00:00:00 2001 From: Alexander A Oganezov Date: Fri, 23 Aug 2024 17:53:16 +0000 Subject: [PATCH 2/2] -retrigger Required-githooks: true Signed-off-by: Alexander A Oganezov