summaryrefslogtreecommitdiffstats
path: root/src/vlibapi/api_shared.c
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2022-08-17 13:26:54 +0000
committerMatthew Smith <mgsmith@netgate.com>2022-08-17 15:35:17 +0000
commitcbc10399d4c30d2188284067c91f58f7cb0cd83d (patch)
treef5f43ed1b3d1f778be5685eaaca1ea9406d23d2f /src/vlibapi/api_shared.c
parenta3018af21db46fc4158ab075bac4009c3640cc59 (diff)
vlib: fix coverity 274744
Add a missing null check Type: fix Change-Id: Id1b27341480c9d62185496ae1d832360119ec198 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/vlibapi/api_shared.c')
-rw-r--r--src/vlibapi/api_shared.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vlibapi/api_shared.c b/src/vlibapi/api_shared.c
index 98da604a456..73ef3ce54d8 100644
--- a/src/vlibapi/api_shared.c
+++ b/src/vlibapi/api_shared.c
@@ -232,7 +232,10 @@ vl_msg_api_trace_write_one (api_main_t *am, u8 *msg, FILE *fp)
u16 id = clib_net_to_host_u16 (*((u16 *) msg));
vl_api_msg_data_t *m = vl_api_get_msg_data (am, id);
- m->endian_handler (tmpmem);
+ if (m && m->endian_handler)
+ {
+ m->endian_handler (tmpmem);
+ }
if (m && m->tojson_handler)
{