From ffd9057493ba75d157d8fd316f4978b64a6efb30 Mon Sep 17 00:00:00 2001 From: Gabriel Oginski Date: Mon, 24 Jan 2022 13:31:45 +0000 Subject: wireguard: fix passing argument Fixed coverity-issue CID 248456. Originally passing argument of type "uint64_t *" to function: "memcopy_s_inline". This patch fixes the problem by changing type of passing argument and make a portable assumption. Type: fix Signed-off-by: Gabriel Oginski Change-Id: I17e4583a05ea1263e4d8a4acc9949454e5fd92c0 --- src/plugins/wireguard/wireguard_output_tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/wireguard/wireguard_output_tun.c b/src/plugins/wireguard/wireguard_output_tun.c index f7ae4d174c0..14df692eebc 100644 --- a/src/plugins/wireguard/wireguard_output_tun.c +++ b/src/plugins/wireguard/wireguard_output_tun.c @@ -282,7 +282,7 @@ wg_add_to_async_frame (vlib_main_t *vm, wg_per_thread_data_t *ptd, *r_idx = kp->kp_remote_index; clib_memset (iv, 0, 4); - clib_memcpy (iv + 4, nonce, sizeof (nonce)); + clib_memcpy (iv + 4, nonce, sizeof (*nonce)); /* this always succeeds because we know the frame is not full */ wg_output_tun_add_to_frame (vm, async_frame, kp->kp_send_index, payload_len, -- cgit 1.2.3-korg