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] printcmd.c, print_scalar_formatted, use strncpy.


checked in.

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

	* printcmd.c (print_scalar_formatted): Use strncpy for safety.

Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.192
diff -u -p -u -p -r1.192 printcmd.c
--- printcmd.c	26 Feb 2011 02:07:08 -0000	1.192
+++ printcmd.c	2 Mar 2011 22:55:38 -0000
@@ -533,7 +533,7 @@ print_scalar_formatted (const void *vala
 	    if (*cp == '\0')
 	      cp--;
 	  }
-	strcpy (buf, cp);
+	strncpy (buf, cp, sizeof (bits));
 	fputs_filtered (buf, stream);
       }
       break;

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