vlib: fix coverity 274744 25/36925/2
authorAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 17 Aug 2022 13:26:54 +0000 (13:26 +0000)
committerMatthew Smith <mgsmith@netgate.com>
Wed, 17 Aug 2022 15:35:17 +0000 (15:35 +0000)
Add a missing null check

Type: fix
Change-Id: Id1b27341480c9d62185496ae1d832360119ec198
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/vlibapi/api_shared.c

index 98da604..73ef3ce 100644 (file)
@@ -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)
     {