misc: address sanitizer: fix instrumentation
Type: fix
Change-Id: I99e3951f8cfb7ab9d2f0a7dcee92199eab29043c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
diff --git a/src/vlibmemory/vlib_api_cli.c b/src/vlibmemory/vlib_api_cli.c
index 3f8e1c9..db48711 100755
--- a/src/vlibmemory/vlib_api_cli.c
+++ b/src/vlibmemory/vlib_api_cli.c
@@ -442,6 +442,8 @@
}
close (fd);
+ CLIB_MEM_UNPOISON (hp, file_size);
+
nitems = ntohl (hp->nitems);
if (last_index == (u32) ~ 0)
@@ -454,6 +456,7 @@
vlib_cli_output (vm, "Range (%d, %d) outside file range (0, %d)\n",
first_index, last_index, nitems - 1);
munmap (hp, file_size);
+ CLIB_MEM_POISON (hp, file_size);
return;
}
if (hp->wrapped)
@@ -465,6 +468,7 @@
saved_print_handlers = (void **) vec_dup (am->msg_print_handlers);
vl_msg_api_custom_dump_configure (am);
}
+
msg = (u8 *) (hp + 1);
u16 *msgid_vec = 0;
@@ -503,6 +507,7 @@
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
munmap (hp, file_size);
+ CLIB_MEM_POISON (hp, file_size);
return;
}
msg += size;
@@ -534,6 +539,7 @@
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
munmap (hp, file_size);
+ CLIB_MEM_POISON (hp, file_size);
vec_free (tmpbuf);
am->replay_in_progress = 0;
return;
@@ -557,6 +563,7 @@
{
vlib_cli_output (vm, "Ugh: msg id %d no endian swap\n", msg_id);
munmap (hp, file_size);
+ CLIB_MEM_POISON (hp, file_size);
vec_free (tmpbuf);
am->replay_in_progress = 0;
return;
@@ -659,6 +666,7 @@
}
munmap (hp, file_size);
+ CLIB_MEM_POISON (hp, file_size);
vec_free (tmpbuf);
am->replay_in_progress = 0;
}