From 086dbf661acc2fbca8dee48e21c9e5e289d7e2f5 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Mon, 28 Feb 2011 00:20:49 +0000 Subject: [PATCH] 2011-02-27 Michael Snyder * tui/tui-stack.c (tui_get_function_from_frame): Fix off by one error in strncpy. --- gdb/ChangeLog | 3 +++ gdb/tui/tui-stack.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a87cfc8..941c611 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2011-02-27 Michael Snyder + * tui/tui-stack.c (tui_get_function_from_frame): Fix off by one + error in strncpy. + * symtab.c (rbreak_command): Move variable 'file_name' to outer scope. diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index d7b9716..f618d7c 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -227,7 +227,7 @@ tui_get_function_from_frame (struct frame_info *fi) them because the status line is too short to display them. */ if (*p == '<') p++; - strncpy (name, p, sizeof (name)); + strncpy (name, p, sizeof (name) - 1); p = strchr (name, '('); if (!p) p = strchr (name, '>'); -- 2.7.4