Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit] printcmd.c, print_scalar_formatted, use strncpy.
@ 2011-03-02 23:00 Michael Snyder
  2011-03-02 23:42 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2011-03-02 23:00 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 13 bytes --]

checked in.


[-- Attachment #2: strncpy2.txt --]
[-- Type: text/plain, Size: 607 bytes --]

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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-03 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 23:00 [commit] printcmd.c, print_scalar_formatted, use strncpy Michael Snyder
2011-03-02 23:42 ` Pedro Alves
2011-03-02 23:56   ` Michael Snyder
2011-03-03 10:20     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox