diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-09-30 16:43:25 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-10-03 16:20:03 +0000 |
commit | f13634f1ab030e82709e3271de3154efcea12afb (patch) | |
tree | c072c4cf7cde0fa5c0ab4a6dbfc7181f5b5606ad /src/plugins/rdma | |
parent | 513a74b855e3564ab7630683a53cafcdfe0d20d7 (diff) |
rdma: fix non-NULL terminated C-string overflow
Type: fix
Change-Id: I584777825636347c116bd084e348858bcb1b7d75
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 7ff07354c3a6969e306f75bf28502a46697abcda)
Diffstat (limited to 'src/plugins/rdma')
-rw-r--r-- | src/plugins/rdma/device.c | 2 | ||||
-rw-r--r-- | src/plugins/rdma/format.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/rdma/device.c b/src/plugins/rdma/device.c index 532f4f530ab..cb88849a7e2 100644 --- a/src/plugins/rdma/device.c +++ b/src/plugins/rdma/device.c @@ -324,7 +324,7 @@ rdma_async_event_init (rdma_device_t * rd) t.file_descriptor = rd->ctx->async_fd; t.error_function = rdma_async_event_error_ready; t.private_data = rd->dev_instance; - t.description = format (0, "%s async event", rd->name); + t.description = format (0, "%v async event", rd->name); rd->async_event_clib_file_index = clib_file_add (&file_main, &t); return 0; diff --git a/src/plugins/rdma/format.c b/src/plugins/rdma/format.c index 798b21d565d..7a97339746f 100644 --- a/src/plugins/rdma/format.c +++ b/src/plugins/rdma/format.c @@ -30,7 +30,7 @@ format_rdma_device_name (u8 * s, va_list * args) rdma_device_t *rd = vec_elt_at_index (rm->devices, i); if (rd->name) - return format (s, "%s", rd->name); + return format (s, "%v", rd->name); s = format (s, "rdma-%u", rd->dev_instance); return s; @@ -59,7 +59,7 @@ format_rdma_device (u8 * s, va_list * args) rdma_device_t *rd = vec_elt_at_index (rm->devices, i); u32 indent = format_get_indent (s); - s = format (s, "netdev: %s\n", rd->linux_ifname); + s = format (s, "netdev: %v\n", rd->linux_ifname); s = format (s, "%Uflags: %U", format_white_space, indent, format_rdma_device_flags, rd); if (rd->error) |