From 35c9fd24a352817a2ada52a9704faa37b5531177 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Tue, 21 Dec 2021 01:12:45 +0000 Subject: [PATCH] libcsa: Resolve uninitialized warnings --- cde/lib/csa/match.c | 4 ++-- cde/lib/csa/rpccalls.c | 2 +- cde/lib/csa/table.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cde/lib/csa/match.c b/cde/lib/csa/match.c index b1423b8e8..95dd7c5e2 100644 --- a/cde/lib/csa/match.c +++ b/cde/lib/csa/match.c @@ -102,7 +102,7 @@ _DtCmHashCriteria( time_t tstart1, tstart2, tend1, tend2; time_t tick; char *name; - cms_attribute_value *val, *hval; + cms_attribute_value *val, *hval = NULL; boolean_t keep; *hnum = 0; @@ -247,7 +247,7 @@ _DtCmHashCriteria( (*hattrs)[j].name.name = name; (*hattrs)[j].name.num = index; - if (val) { + if (val && hval) { (*hattrs)[j].value = &hval[j]; (*hattrs)[j].value->type = val->type; if (csaattrs && diff --git a/cde/lib/csa/rpccalls.c b/cde/lib/csa/rpccalls.c index beeb60794..678ebfe98 100644 --- a/cde/lib/csa/rpccalls.c +++ b/cde/lib/csa/rpccalls.c @@ -1206,7 +1206,7 @@ csa2cmsattrs( { CSA_return_code stat = CSA_SUCCESS; cms_attribute *cmsattrs; - CSA_enum *ops_r; + CSA_enum *ops_r = NULL; CSA_reminder *rptr1, *rptr2; int i,j; diff --git a/cde/lib/csa/table.c b/cde/lib/csa/table.c index c797bd7c8..1c8d38e4d 100644 --- a/cde/lib/csa/table.c +++ b/cde/lib/csa/table.c @@ -1055,7 +1055,7 @@ _DtCm_table_delete( extern CSA_return_code _DtCm_table_size(Calendar *cal, int *size) { - int *res; + int *res = NULL; CSA_return_code stat = CSA_SUCCESS; _DtCm_Connection *conn; @@ -1275,7 +1275,7 @@ _DtCm_table_unregister_target( nullreturned = B_TRUE; break; default: - stat = CSA_E_FAILURE; + return CSA_E_FAILURE; } if (nullreturned) { @@ -1360,7 +1360,7 @@ _DtCm_table_register_target( nullreturned = B_TRUE; break; default: - stat = CSA_E_FAILURE; + return CSA_E_FAILURE; } if (nullreturned) {