diff options
author | Benoît Ganne <bganne@cisco.com> | 2021-01-05 17:47:59 +0100 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2021-01-06 16:36:03 +0000 |
commit | 803c1623c255a6ffbc41e81a1bbd17bffba2ed05 (patch) | |
tree | 91c09dd9dcf257086740964177609583d14fcc1e /src/plugins | |
parent | 95f59f3808ac1aa5562e39893db123a6c6edf1f2 (diff) |
acl: fix cli tag parsing
- tag is expected to be 64-bytes
- when specifying tag on cli, a vector is allocated. Make sure it is
freed
Type: fix
Change-Id: Id1741fe406819ca9f71edb081d4483f52cae547d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/acl/acl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/acl/acl.c b/src/plugins/acl/acl.c index 35f8b8cb82d..7cde5ce60ad 100644 --- a/src/plugins/acl/acl.c +++ b/src/plugins/acl/acl.c @@ -2828,7 +2828,7 @@ acl_set_aclplugin_acl_fn (vlib_main_t * vm, u32 tcpflags, tcpmask; u32 src_prefix_length = 0, dst_prefix_length = 0; ip46_address_t src, dst; - u8 *tag = (u8 *) "cli"; + u8 *tag = 0; if (!unformat_user (input, unformat_line_input, line_input)) return 0; @@ -2934,10 +2934,14 @@ acl_set_aclplugin_acl_fn (vlib_main_t * vm, } u32 acl_index = ~0; + if (!tag) + vec_add (tag, "cli", 4); + vec_validate (tag, STRUCT_SIZE_OF (acl_list_t, tag) - 1); rv = acl_add_list (vec_len (rules), rules, &acl_index, tag); vec_free (rules); + vec_free (tag); if (rv) return (clib_error_return (0, "failed")); |