summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vpp/api/api_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vpp/api/api_main.c b/src/vpp/api/api_main.c
index 7913bc01e9d..d3764337b11 100644
--- a/src/vpp/api/api_main.c
+++ b/src/vpp/api/api_main.c
@@ -47,6 +47,8 @@ api_main_init (vlib_main_t * vm)
vam->vlib_main = vm;
vam->my_client_index = (u32) ~ 0;
+ /* Ensure that vam->inbuf is never NULL */
+ vec_validate (vam->inbuf, 0);
init_error_string_table (vam);
rv = vat_plugin_init (vam);
if (rv)
@@ -82,6 +84,14 @@ api_command_fn (vlib_main_t * vm,
vam->vl_input_queue = am->shmem_hdr->vl_input_queue;
+#ifdef __COVERITY
+ /*
+ * Convince Coverity that it's not a NULL pointer...
+ * Done once for real below, since we never vec_free(vam->inbuf);
+ */
+ vec_validate (vam->inbuf, 0);
+#endif
+
vec_reset_length (vam->inbuf);
vam->input = &_input;