diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-04-29 16:31:24 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-05-01 07:36:48 +0000 |
commit | e7a527f928a65c4f489ba2f6d393de1924f161bd (patch) | |
tree | e12780edbd90f03b59a0a0cf65b5e0d17c932f67 | |
parent | 1f8eeb7cb90b51c8682818bb0d68cc121f08b481 (diff) |
ipsec: fix ipsec format overflow
hi->name is not NULL-terminated. Use specialized format function which
does the right thing.
Change-Id: Iadda51461af0c1ad4f38a6d24b76e816020f35c8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
-rw-r--r-- | src/vnet/ipsec/ipsec_format.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c index 44f064d6112..284dd6f5513 100644 --- a/src/vnet/ipsec/ipsec_format.c +++ b/src/vnet/ipsec/ipsec_format.c @@ -336,7 +336,6 @@ format_ipsec_tunnel (u8 * s, va_list * args) { ipsec_main_t *im = &ipsec_main; u32 ti = va_arg (*args, u32); - vnet_hw_interface_t *hi; ipsec_tunnel_if_t *t; if (pool_is_free_index (im->tunnel_interfaces, ti)) @@ -350,9 +349,9 @@ format_ipsec_tunnel (u8 * s, va_list * args) if (t->hw_if_index == ~0) goto done; - hi = vnet_get_hw_interface (im->vnet_main, t->hw_if_index); - - s = format (s, "%s\n", hi->name); + s = + format (s, "%U\n", format_vnet_hw_if_index_name, im->vnet_main, + t->hw_if_index); s = format (s, " out-bound sa: "); s = format (s, "%U\n", format_ipsec_sa, t->output_sa_index, |