This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] tui/tui-stack.c: fix off-by-one in strncpy


2011-02-27  Michael Snyder  <msnyder@vmware.com>

	* tui/tui-stack.c (tui_get_function_from_frame): Fix off by one
	error in strncpy.

Index: tui/tui-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-stack.c,v
retrieving revision 1.39
diff -u -p -u -p -r1.39 tui-stack.c
--- tui/tui-stack.c	6 Jan 2011 00:57:05 -0000	1.39
+++ tui/tui-stack.c	28 Feb 2011 00:19:11 -0000
@@ -227,7 +227,7 @@ tui_get_function_from_frame (struct fram
      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, '>');

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]