diff --git a/IP/IPv4/net_ipv4.c b/IP/IPv4/net_ipv4.c index c5abdbb..034e878 100644 --- a/IP/IPv4/net_ipv4.c +++ b/IP/IPv4/net_ipv4.c @@ -8293,11 +8293,11 @@ static void NetIPv4_TxPktValidateOpt (void *p_opts, NET_ERR *p_err) { CPU_INT08U opt_len_size; - CPU_INT08U opt_len; + CPU_INT08U opt_len = 0; CPU_INT08U opt_nbr_route_ts; NET_IPv4_OPT_TYPE *p_opt_cfg_type; void *p_opt_cfg; - void *p_opt_next; + void *p_opt_next = (void *)0; opt_len_size = 0u; diff --git a/IP/IPv6/net_icmpv6.c b/IP/IPv6/net_icmpv6.c index f681298..47aff3f 100644 --- a/IP/IPv6/net_icmpv6.c +++ b/IP/IPv6/net_icmpv6.c @@ -1923,7 +1923,7 @@ NET_ICMPv6_REQ_ID_SEQ NetICMPv6_TxMsgReqHandler (NET_IF_NBR if_nbr, NET_BUF *p_msg_req_head; NET_BUF *p_chain_buf; NET_BUF *p_chain_buf_next; - NET_BUF_HDR *p_msg_req_hdr; + NET_BUF_HDR *p_msg_req_hdr = (void *)0; NET_BUF_HDR *p_chain_buf_hdr; NET_ICMPv6_HDR_ECHO *p_icmp_hdr_echo; NET_NDP_NEIGHBOR_SOL_HDR *p_icmp_hdr_neighbor_sol; @@ -2672,7 +2672,7 @@ static void NetICMPv6_RxPktValidate (NET_BUF *p_buf, CPU_INT16U icmp_msg_len_min; CPU_INT16U icmp_msg_len_max; CPU_INT16U icmp_msg_len; - NET_ICMPv6_HDR_PARAM_PROB *p_icmp_param_prob; + NET_ICMPv6_HDR_PARAM_PROB *p_icmp_param_prob = (void *)0; NET_BUF *p_buf_next; NET_BUF_HDR *p_buf_next_hdr; NET_IPv6_PSEUDO_HDR ipv6_pseudo_hdr; diff --git a/IP/IPv6/net_mldp.c b/IP/IPv6/net_mldp.c index bb637b3..d5cf828 100644 --- a/IP/IPv6/net_mldp.c +++ b/IP/IPv6/net_mldp.c @@ -552,7 +552,7 @@ CPU_BOOLEAN NetMLDP_HostGrpLeave (NET_IF_NBR if_nbr, NET_IPv6_ADDR *p_addr, NET_ERR *p_err) { - CPU_BOOLEAN host_grp_leave; + CPU_BOOLEAN host_grp_leave = DEF_FAIL; /* Acquire net lock (see Note #1b). */ diff --git a/IP/IPv6/net_ndp.c b/IP/IPv6/net_ndp.c index dcb49b5..55c5a39 100644 --- a/IP/IPv6/net_ndp.c +++ b/IP/IPv6/net_ndp.c @@ -1258,19 +1258,19 @@ const NET_IPv6_ADDR *NetNDP_NextHop ( NET_IF_NBR *p_if_nbr, NET_ERR *p_err) { NET_IF_NBR if_nbr; - NET_NDP_DEST_CACHE *p_dest; + NET_NDP_DEST_CACHE *p_dest = (void *)0; NET_NDP_DEST_CACHE *p_dest_tmp; NET_NDP_ROUTER *p_router; - const NET_IPv6_ADDR *p_addr_nexthop; + const NET_IPv6_ADDR *p_addr_nexthop = (void *)0; NET_IPv6_ADDR *p_addr_nexthop_tmp; NET_IF_NBR if_nbr_tmp; - NET_IF_NBR if_nbr_src_addr; + NET_IF_NBR if_nbr_src_addr = 0; CPU_INT08U valid_nbr_current; CPU_INT08U valid_nbr_best; CPU_BOOLEAN link_local; CPU_BOOLEAN addr_mcast; CPU_BOOLEAN on_link; - CPU_BOOLEAN add_dest; + CPU_BOOLEAN add_dest = DEF_NO; CPU_BOOLEAN add_dest_tmp; CPU_BOOLEAN dflt_router; CPU_BOOLEAN is_mcast_grp; diff --git a/Source/net_bsd.h b/Source/net_bsd.h index 5cb699d..2d5c278 100644 --- a/Source/net_bsd.h +++ b/Source/net_bsd.h @@ -188,22 +188,22 @@ #ifdef IN6ADDR_ANY_INIT #undef IN6ADDR_ANY_INIT #endif - #define IN6ADDR_ANY_INIT { 0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } + #define IN6ADDR_ANY_INIT {{ 0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }} #ifdef IN6ADDR_LOOPBACK_INIT #undef IN6ADDR_LOOPBACK_INIT #endif - #define IN6ADDR_LOOPBACK_INIT { 0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } + #define IN6ADDR_LOOPBACK_INIT {{ 0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }} #ifdef IN6ADDR_LINKLOCAL_ALLNODES_INIT #undef IN6ADDR_LINKLOCAL_ALLNODES_INIT #endif - #define IN6ADDR_LINKLOCAL_ALLNODES_INIT { 0xFF,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } + #define IN6ADDR_LINKLOCAL_ALLNODES_INIT {{ 0xFF,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }} #ifdef IN6ADDR_LINKLOCAL_ALLROUTERS_INIT #undef IN6ADDR_LINKLOCAL_ALLROUTERS_INIT #endif - #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT { 0xFF,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } + #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT {{ 0xFF,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 }} #define INET6_ADDRSTRLEN 46 diff --git a/Source/net_sock.c b/Source/net_sock.c index 630cb29..3709d85 100644 --- a/Source/net_sock.c +++ b/Source/net_sock.c @@ -6227,7 +6227,7 @@ NET_SOCK_RTN_CODE NetSock_Sel (NET_SOCK_QTY sock_nbr_max, LIB_ERR lib_err; KAL_ERR err_kal; KAL_ERR err_kal_del; - NET_ERR err; + NET_ERR err = 0; @@ -16606,7 +16606,7 @@ static NET_SOCK_RTN_CODE NetSock_RxDataHandler (NET_SOCK_ID sock_id, CPU_BOOLEAN secure; #endif NET_SOCK *p_sock; - NET_SOCK_RTN_CODE rtn_code; + NET_SOCK_RTN_CODE rtn_code = 0; @@ -17900,7 +17900,7 @@ static NET_SOCK_RTN_CODE NetSock_TxDataHandler (NET_SOCK_ID sock_id, CPU_BOOLEAN secure; #endif NET_SOCK *p_sock; - NET_SOCK_RTN_CODE rtn_code; + NET_SOCK_RTN_CODE rtn_code = 0; diff --git a/Source/net_tcp.c b/Source/net_tcp.c index 16ad85d..73ead4f 100644 --- a/Source/net_tcp.c +++ b/Source/net_tcp.c @@ -12065,7 +12065,7 @@ static void NetTCP_RxPktConnHandlerFinWait2 (NET_TCP_CONN *p_conn, NET_TCP_SEQ_CODE seq_code; NET_TCP_ACK_CODE ack_code; NET_TCP_RESET_CODE reset_code; - CPU_BOOLEAN data_avail; + CPU_BOOLEAN data_avail = DEF_NO; NET_TMR_TICK timeout_tick; CPU_FNCT_PTR timeout_fnct; NET_TCP_FREE_CODE free_code; @@ -16434,7 +16434,6 @@ static void NetTCP_RxPktConnHandlerReTxQ (NET_TCP_CONN *p_conn, NET_TCP_SEQ_NBR seq_nbr_next = 0u; NET_TCP_SEQ_NBR seq_nbr = 0u; NET_TCP_SEG_SIZE seg_len = 0u; - NET_TCP_SEG_SIZE seg_len_tot = 0u; NET_TCP_SEG_SIZE seg_len_data = 0u; NET_TCP_SEG_SIZE seg_len_data_tot = 0u; NET_TCP_TX_RTT_TS_MS seg_rtt_ts_txd_ms = 0u; @@ -16588,7 +16587,6 @@ static void NetTCP_RxPktConnHandlerReTxQ (NET_TCP_CONN *p_conn, p_buf_q_head = p_conn->ReTxQ_Head; p_buf_q_prev = DEF_NULL; p_buf_q = p_buf_q_head; - seg_len_tot = 0u; seg_len_data_tot = 0u; /* Chk re-tx'd seg(s) [see Notes #8a2A1 & #4]. */ segs_re_txd = (p_conn->TxSeqNbrUnAckdPrev == p_conn->TxSeqNbrUnReTxd) @@ -16633,7 +16631,6 @@ static void NetTCP_RxPktConnHandlerReTxQ (NET_TCP_CONN *p_conn, p_buf_q_prev = p_buf_q; p_buf_q = p_buf_q_next; /* ... adv to next re-tx Q seg. */ p_conn->TxSeqNbrUnAckdAlignDelta = 0u; - seg_len_tot += seg_len; seg_len_data_tot += seg_len_data; seqs_ackd = DEF_YES; @@ -16662,7 +16659,6 @@ static void NetTCP_RxPktConnHandlerReTxQ (NET_TCP_CONN *p_conn, p_buf_q_hdr->TCP_SeqNbr += ack_delta_seq_align; p_buf_q_hdr->TCP_SegLen -= ack_delta_seq_align; p_buf_q_hdr->TCP_SegLenData -= ack_delta_seq_align; - seg_len_tot += ack_delta_seq_align; seg_len_data_tot += ack_delta_seq_align; /* ... & update TCP tx buf ctrls. */ p_buf_q_hdr->DataIx += ack_delta_seq_align; @@ -28810,7 +28806,7 @@ static void NetTCP_TxPktValidateOpt (void *p_opts_tcp, CPU_INT08U opt_nbr_max_seg_size; NET_TCP_OPT_TYPE *p_opt_cfg_type; void *p_opt_cfg; - void *p_opt_next; + void *p_opt_next = (void *)0; opt_len_size = 0u; @@ -29728,7 +29724,7 @@ static void NetTCP_TxPktPrepareHdr (NET_BUF *p_buf, NET_TCP_HDR_FLAGS tcp_flags; NET_TCP_HDR_FLAGS tcp_hdr_len_flags; CPU_INT16U tcp_opt_ix; - NET_CHK_SUM tcp_chk_sum; + NET_CHK_SUM tcp_chk_sum = 0u; /* ----------------- UPDATE BUF CTRLS ----------------- */ p_buf_hdr->TransportHdrLen = tcp_hdr_len_tot;