]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Annotate false positive uninit_use (CID #1503898) (#4719)
authorJames Jones <jejones3141@gmail.com>
Mon, 12 Sep 2022 23:41:47 +0000 (18:41 -0500)
committerGitHub <noreply@github.com>
Mon, 12 Sep 2022 23:41:47 +0000 (19:41 -0400)
find is uninitialized and only has a small portion of find.addr.inet
set in fr_redis_cluster_pool_by_node_addr(), but then all of find.addr
is assigned to spare->pending_addr, hence coverity complains. It turna
out, though, that cluster_node_connect() only uses the part that did
get set.

src/lib/redis/cluster.c

index bc4ce08f5ba25b4a8f6e366995d949d146c46203..c715d2bb149b38be0c932bd7b685c5d56f2e191c 100644 (file)
@@ -2053,6 +2053,7 @@ int fr_redis_cluster_pool_by_node_addr(fr_pool_t **pool, fr_redis_cluster_t *clu
                        pthread_mutex_unlock(&cluster->mutex);
                        return -1;
                }
+               /* coverity[uninit_use] */
                spare->pending_addr = find.addr;        /* Set the config to be applied */
                if (cluster_node_connect(cluster, spare) < 0) {
                        pthread_mutex_unlock(&cluster->mutex);