From 4e2af517f12dc3ac61278947995bc8918069a297 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 25 Apr 2012 08:16:43 +0000 Subject: 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. --- gdb/tui/tui-stack.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gdb/tui') 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, '>'); -- cgit v1.1