This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] printcmd.c, print_scalar_formatted, use strncpy.
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 02 Mar 2011 15:00:23 -0800
- Subject: [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;