Hi Thien,
Ack.
Regards, 
Thanh

-----Original Message-----
From: Thien Minh Huynh <thien.m.hu...@dektech.com.au> 
Sent: Wednesday, 3 February 2021 7:42 PM
To: Thang Duc Nguyen <thang.d.ngu...@dektech.com.au>; Thanh Nguyen 
<thanh.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Thien Minh Huynh 
<thien.m.hu...@dektech.com.au>
Subject: [PATCH 1/1] clm: use calloc instead malloc to remove garbage value 
[#3251]

The buffer nodeAddress having the garbage value. That leading to pyosaf clma is 
stuck during decode byte-string.

The fix is make sure buffer clean before stored.
---
 src/clm/agent/clma_mds.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/clm/agent/clma_mds.cc b/src/clm/agent/clma_mds.cc index 
7b7d6a5c8..3e7cb7db2 100644
--- a/src/clm/agent/clma_mds.cc
+++ b/src/clm/agent/clma_mds.cc
@@ -502,7 +502,7 @@ static uint32_t clma_dec_cluster_ntf_buf_msg(
   total_bytes += 4;
 
   param->notification = static_cast<SaClmClusterNotificationT_4 *>(
-      malloc(sizeof(SaClmClusterNotificationT_4) * param->numberOfItems));
+      calloc(param->numberOfItems, 
+ sizeof(SaClmClusterNotificationT_4)));
   if (param->notification == nullptr) {
     TRACE("Can not allocate memory notification!!!\n");
     TRACE_LEAVE();
--
2.25.1



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

Reply via email to