From: Benoît Ganne Date: Mon, 29 Aug 2022 09:56:08 +0000 (+0200) Subject: nat: fix coverity 249202 X-Git-Tag: v23.02-rc0~65 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=f4f1b959c070ce462846d5666d60dc5624dd271b;p=vpp.git nat: fix coverity 249202 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 --- 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;