diff options
author | Gabriel Oginski <gabrielx.oginski@intel.com> | 2022-02-16 12:32:53 +0000 |
---|---|---|
committer | Fan Zhang <roy.fan.zhang@intel.com> | 2022-02-18 09:50:41 +0000 |
commit | c810c33f846c2d694ffcd715e917206a9a0a038d (patch) | |
tree | 51f8f5f0c4d35b3b82a2f0c5779b9553b1992265 /src/plugins/wireguard/wireguard_input.c | |
parent | 699bea24944907fed5f7516e339aa2eca7c2dd17 (diff) |
wireguard: fix passing null pointer
Type: fix
Fixed coverity-issue CID 248517.
Originally possibly passing null pointer to one function and
directly dereferences it.
This patch fixes the problem by add a new condition.
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I02fc6fb5d1cfd6138ea4ba2b1946fd8a7ef34d3b
Diffstat (limited to 'src/plugins/wireguard/wireguard_input.c')
-rw-r--r-- | src/plugins/wireguard/wireguard_input.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/wireguard/wireguard_input.c b/src/plugins/wireguard/wireguard_input.c index dbdcaa0f45a..ba5a1d679e2 100644 --- a/src/plugins/wireguard/wireguard_input.c +++ b/src/plugins/wireguard/wireguard_input.c @@ -902,6 +902,7 @@ wg_input_post (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame) last_rec_idx = data->receiver_index; } + ASSERT (peer != NULL); /* this pointer never should be NULL */ if (PREDICT_FALSE (wg_input_post_process (vm, b[0], next, peer, data, &is_keepalive) < 0)) goto trace; |