Hi Gary,

ACK from me.

Best Regards,
ThuanTr

-----Original Message-----
From: Gary Lee <gary....@dektech.com.au> 
Sent: Thursday, October 3, 2019 12:11 PM
To: thuan.t...@dektech.com.au; minh.c...@dektech.com.au;
hans.nordeb...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net; Gary Lee <gary....@dektech.com.au>
Subject: [PATCH 1/1] amf: add asserts to problematic areas identified by
codechecker [#3077]

---
 src/amf/amfd/sg_nway_fsm.cc | 2 ++
 src/amf/amfd/sgtype.cc      | 1 +
 src/amf/amfnd/comp.cc       | 2 ++
 src/amf/amfnd/susm.cc       | 1 +
 4 files changed, 6 insertions(+)

diff --git a/src/amf/amfd/sg_nway_fsm.cc b/src/amf/amfd/sg_nway_fsm.cc index
f7ddc57..2c17b5a 100644
--- a/src/amf/amfd/sg_nway_fsm.cc
+++ b/src/amf/amfd/sg_nway_fsm.cc
@@ -2589,6 +2589,8 @@ static AVD_SU_SI_REL
*find_pref_standby_susi(AVD_SU_SI_REL *sisu) {
 
   TRACE_ENTER();
 
+  osafassert(sisu != nullptr);
+  osafassert(sisu->si != nullptr);
   curr_sisu = sisu->si->list_of_sisu;
   while (curr_sisu) {
     if ((SA_AMF_READINESS_IN_SERVICE ==
curr_sisu->su->saAmfSuReadinessState) && diff --git a/src/amf/amfd/sgtype.cc
b/src/amf/amfd/sgtype.cc index 15fae9c..64ebbd7 100644
--- a/src/amf/amfd/sgtype.cc
+++ b/src/amf/amfd/sgtype.cc
@@ -439,6 +439,7 @@ static void sgtype_ccb_apply_modify_hdlr(struct
CcbUtilOperationData *opdata) {
     LOG_WA("SGT modify apply (STDBY): sgt does not exist");
     return;
   }
+  osafassert(sgt != nullptr);
 
   while ((attr_mod = opdata->param.modify.attrMods[i++]) != nullptr) {
     bool value_is_deleted;
diff --git a/src/amf/amfnd/comp.cc b/src/amf/amfnd/comp.cc index
b520550..a12171c 100644
--- a/src/amf/amfnd/comp.cc
+++ b/src/amf/amfnd/comp.cc
@@ -2785,6 +2785,7 @@ uint32_t comp_restart_initiate(AVND_COMP *comp) {
     // reset contained comps for this container
     AVND_COMP_CSI_REC *curr_csi(m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(
       m_NCS_DBLIST_FIND_FIRST(&comp->csi_list)));
+    osafassert(curr_csi != nullptr);
     const std::string& containerCsi(curr_csi->name);
 
     for (auto &it : cb->compdb) {
@@ -2837,6 +2838,7 @@ uint32_t comp_restart_initiate(AVND_COMP *comp) {
   if (!m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(comp)) {
     AVND_COMP_CSI_REC *csi = m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(
         m_NCS_DBLIST_FIND_FIRST(&comp->csi_list));
+    osafassert(csi != nullptr);
     if (m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_ASSIGNED(csi) ||
         m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_RESTARTING(csi)) {
       m_AVND_COMP_CSI_CURR_ASSIGN_STATE_SET(
diff --git a/src/amf/amfnd/susm.cc b/src/amf/amfnd/susm.cc index
6376327..c1aa9e4 100644
--- a/src/amf/amfnd/susm.cc
+++ b/src/amf/amfnd/susm.cc
@@ -392,6 +392,7 @@ uint32_t avnd_su_si_msg_prc(AVND_CB *cb, AVND_SU *su,
AVND_SU_SI_PARAM *info) {
       if (true == info->single_csi) {
         AVND_COMP_CSI_PARAM *csi_param;
         AVND_COMP_CSI_REC *csi_rec;
+        osafassert(si != nullptr);
         si->single_csi_add_rem_in_si = AVSV_SUSI_ACT_DEL;
         osafassert((info->num_assigns == 1));
         csi_param = info->list;
--
2.7.4




_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to