vppinfra: make _vec_len() read-only
Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:

committed by
Damjan Marion

parent
a2b358b1fa
commit
8bea589cfe
@ -176,7 +176,7 @@ api_command_fn (vlib_main_t * vm,
|
||||
maybe_register_api_client (vam);
|
||||
|
||||
/* vec_validated in the init routine */
|
||||
_vec_len (vam->inbuf) = 0;
|
||||
vec_set_len (vam->inbuf, 0);
|
||||
|
||||
vam->input = &_input;
|
||||
|
||||
|
@ -170,7 +170,7 @@ vat_load_new_plugins (plugin_main_t * pm)
|
||||
{
|
||||
vec_free (file_name);
|
||||
vec_free (plugin_name);
|
||||
_vec_len (pm->plugin_info) = vec_len (pm->plugin_info) - 1;
|
||||
vec_set_len (pm->plugin_info, vec_len (pm->plugin_info) - 1);
|
||||
continue;
|
||||
}
|
||||
hash_set_mem (pm->plugin_by_name_hash, plugin_name,
|
||||
|
Reference in New Issue
Block a user