From f4f1b959c070ce462846d5666d60dc5624dd271b Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 29 Aug 2022 11:56:08 +0200 Subject: nat: fix coverity 249202 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In case of a bad packet, the bihash kv is not initialized before being copied in the trace. Make sure it is initialized to 0. Type: fix Change-Id: I22fcfe99f3586d0fa128493059547a56557b8fb5 Signed-off-by: Benoît Ganne --- src/plugins/nat/nat44-ed/nat44_ed_out2in.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/nat') diff --git a/src/plugins/nat/nat44-ed/nat44_ed_out2in.c b/src/plugins/nat/nat44-ed/nat44_ed_out2in.c index e53d9c5a2de..33449122e43 100644 --- a/src/plugins/nat/nat44-ed/nat44_ed_out2in.c +++ b/src/plugins/nat/nat44-ed/nat44_ed_out2in.c @@ -759,7 +759,7 @@ nat44_ed_out2in_fast_path_node_fn_inline (vlib_main_t * vm, ip_protocol_t proto0; ip4_header_t *ip0; snat_session_t *s0 = 0; - clib_bihash_kv_16_8_t kv0, value0; + clib_bihash_kv_16_8_t kv0 = {}, value0; nat_translation_error_e translation_error = NAT_ED_TRNSL_ERR_SUCCESS; nat_slow_path_reason_e slow_path_reason = NAT_ED_SP_REASON_NO_REASON; nat_6t_flow_t *f = 0; @@ -1060,7 +1060,7 @@ nat44_ed_out2in_slow_path_node_fn_inline (vlib_main_t * vm, udp_header_t *udp0; icmp46_header_t *icmp0; snat_session_t *s0 = 0; - clib_bihash_kv_16_8_t kv0, value0; + clib_bihash_kv_16_8_t kv0 = {}, value0; lb_nat_type_t lb_nat0; twice_nat_type_t twice_nat0; u8 identity_nat0; -- cgit 1.2.3-korg