Hi Alex , ACK, Not tested.
-AVM On 8/9/2017 12:02 AM, Alex Jones wrote:
==27393== Thread 4: ==27393== Conditional jump or move depends on uninitialised value(s) ==27393== at 0x4C2F336: __memcmp_sse4_1 (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==27393== by 0x4E64ADF: ncs_patricia_tree_add (patricia.c:263) ==27393== by 0x1113FB: dtm_node_add (dtm_node_db.c:279) ==27393== by 0x115794: dtm_process_accept (dtm_node_sockets.c:1568) ==27393== by 0x110973: node_discovery_process (dtm_node.c:699) ==27393== by 0x50C4733: start_thread (in /lib64/libpthread-2.22.so) ==27393== by 0x53C2D3C: clone (in /lib64/libc-2.22.so) ==27393== Uninitialised value was created by a stack allocation ==27393== at 0x115384: dtm_process_accept (dtm_node_sockets.c:1468) ==27393== Some uninitialized memory errors and crashes are observed when trying to clean up after failing to add a new node. Fix the uninitialzed memory errors and crashes. --- src/dtm/dtmnd/dtm_node_db.c | 8 ++++---- src/dtm/dtmnd/dtm_node_sockets.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dtm/dtmnd/dtm_node_db.c b/src/dtm/dtmnd/dtm_node_db.c index 78bdb56..59278a5 100644 --- a/src/dtm/dtmnd/dtm_node_db.c +++ b/src/dtm/dtmnd/dtm_node_db.c @@ -282,7 +282,7 @@ uint32_t dtm_node_add(DTM_NODE_DB *node, int i) TRACE( "DTM:ncs_patricia_tree_add for node_ip FAILED for :%s :%u", node->node_ip, rc); - node->pat_comm_socket.key_info = NULL; + node->pat_ip_address.key_info = NULL; goto done; } break; @@ -318,7 +318,7 @@ uint32_t dtm_node_delete(DTM_NODE_DB *node, int i) switch (i) {case 0:- if (node->node_id != 0) { + if (node->node_id != 0 && node->pat_nodeid.key_info) { TRACE( "DTM:Deleting node_id from the database with node_id :%u as key", node->node_id); @@ -333,7 +333,7 @@ uint32_t dtm_node_delete(DTM_NODE_DB *node, int i) } break; case 1: - if (node->comm_socket != 0) { + if (node->comm_socket != 0 && node->pat_comm_socket.key_info) { TRACE( "DTM:Deleting comm_socket from the database with comm_socket :%u as key", node->comm_socket); @@ -349,7 +349,7 @@ uint32_t dtm_node_delete(DTM_NODE_DB *node, int i) break;case 2:- if (node->node_ip != NULL) { + if (node->node_ip != NULL && node->pat_ip_address.key_info) { TRACE( "DTM:Deleting node_ip from the database with node_ip :%s as key", node->node_ip); diff --git a/src/dtm/dtmnd/dtm_node_sockets.c b/src/dtm/dtmnd/dtm_node_sockets.c index e621d5f..55b0374 100644 --- a/src/dtm/dtmnd/dtm_node_sockets.c +++ b/src/dtm/dtmnd/dtm_node_sockets.c @@ -1470,7 +1470,7 @@ int dtm_process_accept(DTM_INTERNODE_CB *dtms_cb, int stream_sock) /* Set length of client address structure (in-out parameter) */ socklen_t clnt_addrLen = sizeof(clnt_addr); void *numericAddress = NULL; /* Pointer to binary address */ - char addrBuffer[INET6_ADDRSTRLEN]; + char addrBuffer[INET6_ADDRSTRLEN] = { 0 }; int err = 0; DTM_NODE_DB node; DTM_NODE_DB *new_node;
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
