@@ -857,7 +857,7 @@ int m_copy_statusmessage(const Messenger *m, int32_t friendnumber, uint8_t *buf,
857857 const uint32_t msglen = min_u32 (maxlen , m -> friendlist [friendnumber ].statusmessage_length );
858858
859859 memcpy (buf , m -> friendlist [friendnumber ].statusmessage , msglen );
860- memset (buf + msglen , 0 , maxlen - msglen );
860+ memzero (buf + msglen , maxlen - msglen );
861861 return msglen ;
862862}
863863
@@ -2620,7 +2620,7 @@ static bool self_announce_group(const Messenger *m, GC_Chat *chat, Onion_Friend
26202620 if (tcp_num > 0 ) {
26212621 pk_copy (chat -> announced_tcp_relay_pk , announce .base_announce .tcp_relays [0 ].public_key );
26222622 } else {
2623- memset (chat -> announced_tcp_relay_pk , 0 , sizeof (chat -> announced_tcp_relay_pk ));
2623+ memzero (chat -> announced_tcp_relay_pk , sizeof (chat -> announced_tcp_relay_pk ));
26242624 }
26252625
26262626 LOGGER_DEBUG (chat -> log , "Published group announce. TCP relays: %d, UDP status: %d" , tcp_num ,
@@ -3416,10 +3416,9 @@ static uint32_t path_node_size(const Messenger *m)
34163416non_null ()
34173417static uint8_t * save_path_nodes (const Messenger * m , uint8_t * data )
34183418{
3419- Node_format nodes [NUM_SAVED_PATH_NODES ];
3419+ Node_format nodes [NUM_SAVED_PATH_NODES ] = {{{ 0 }}} ;
34203420 uint8_t * temp_data = data ;
34213421 data = state_write_section_header (data , STATE_COOKIE_TYPE , 0 , STATE_TYPE_PATH_NODE );
3422- memset (nodes , 0 , sizeof (nodes ));
34233422 const unsigned int num = onion_backup_nodes (m -> onion_c , nodes , NUM_SAVED_PATH_NODES );
34243423 const int l = pack_nodes (m -> log , data , NUM_SAVED_PATH_NODES * packed_node_size (net_family_tcp_ipv6 ()), nodes , num );
34253424
0 commit comments