From 4f113d6066f864261901576df9bde1b0aa9e2de2 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Fri, 20 Apr 2018 16:40:46 -0400 Subject: [PATCH] lib: fix dynamic stack buffer overflow oops Signed-off-by: Quentin Young --- lib/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/thread.c b/lib/thread.c index f3129e39e8..8764c055cb 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -140,7 +140,7 @@ static void cpu_record_print(struct vty *vty, thread_type filter) char underline[strlen(name) + 1]; memset(underline, '-', sizeof(underline)); - underline[sizeof(underline)] = '\0'; + underline[sizeof(underline) - 1] = '\0'; vty_out(vty, "\n"); vty_out(vty, "Showing statistics for pthread %s\n", -- 2.39.5