Ack.
-----Original Message-----
From: Thien Minh Huynh <[email protected]>
Sent: Wednesday, February 3, 2021 3:42 PM
To: Thang Duc Nguyen <[email protected]>; Thanh Nguyen
<[email protected]>
Cc: [email protected]; Thien Minh Huynh
<[email protected]>
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel