diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-09-11 16:40:04 +0200 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2019-09-12 14:18:14 +0000 |
commit | 58519563acc0933771172941291b7d0de2ffeddc (patch) | |
tree | be3730ce6a9319c04576078c86d11d47849c4ac8 /src/plugins/hs_apps/sapi/vpp_echo.c | |
parent | 6d6456ab421ee30f14aded964bad2d3ba55bcf20 (diff) |
hsa: fix memory management bugs
Fix use-after-free and non-null terminated string.
Type: fix
Change-Id: Ibba2a6cae68c612a34477aa813b3bf27a0c8fc1f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/hs_apps/sapi/vpp_echo.c')
-rw-r--r-- | src/plugins/hs_apps/sapi/vpp_echo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c index 18997599113..c72bf18f264 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo.c +++ b/src/plugins/hs_apps/sapi/vpp_echo.c @@ -160,7 +160,7 @@ print_global_stats (echo_main_t * em) s = format (0, "%U:%U", echo_format_timing_event, em->timing.start_event, echo_format_timing_event, em->timing.end_event); - fformat (stdout, "Timing %s\n", s); + fformat (stdout, "Timing %v\n", s); fformat (stdout, "-------- TX --------\n"); fformat (stdout, "%lld bytes (%lld mbytes, %lld gbytes) in %.6f seconds\n", em->stats.tx_total, em->stats.tx_total / (1ULL << 20), @@ -220,8 +220,8 @@ echo_free_sessions (echo_main_t * em) s = pool_elt_at_index (em->sessions, *session_index); echo_session_handle_add_del (em, s->vpp_session_handle, SESSION_INVALID_INDEX); - pool_put (em->sessions, s); clib_memset (s, 0xfe, sizeof (*s)); + pool_put (em->sessions, s); } } |