aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorJim Meyering <meyering@sourceware.org>2012-04-25 08:16:43 +0000
committerJim Meyering <meyering@sourceware.org>2012-04-25 08:16:43 +0000
commit4e2af517f12dc3ac61278947995bc8918069a297 (patch)
tree1b04aab71477ae53eff86c751d605f821230fa1c /gdb/tui
parentb77b7f52b886b60cfc13858d1d3f0b8e8d702147 (diff)
downloadgdb-4e2af517f12dc3ac61278947995bc8918069a297.zip
gdb-4e2af517f12dc3ac61278947995bc8918069a297.tar.gz
gdb-4e2af517f12dc3ac61278947995bc8918069a297.tar.bz2
avoid a few strncpy-induced buffer overruns
* procfs.c (procfs_make_note_section): Be sure to NUL-terminate fname and psargs before trying to concatenate. * tui/tui-stack.c (tui_get_function_from_frame): NUL-terminate "name" before applying strchr.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-stack.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index ef50a98..262a6bf 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -228,6 +228,7 @@ tui_get_function_from_frame (struct frame_info *fi)
if (*p == '<')
p++;
strncpy (name, p, sizeof (name) - 1);
+ name[sizeof (name) - 1] = 0;
p = strchr (name, '(');
if (!p)
p = strchr (name, '>');