From: Michael Snyder Date: Wed, 2 Mar 2011 22:56:44 +0000 (+0000) Subject: 2011-03-02 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=daac021a6ce0a672d67ff5d289851befbf0b9689;p=binutils-gdb.git 2011-03-02 Michael Snyder * printcmd.c (print_scalar_formatted): Use strncpy for safety. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 51c509239fe..ae76da176ab 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2011-03-02 Michael Snyder + * printcmd.c (print_scalar_formatted): Use strncpy for safety. + * infcall.c (call_function_by_hand): Add break statements for lint. * utils.c (parse_escape): Escape the escape char. diff --git a/gdb/printcmd.c b/gdb/printcmd.c index e78acb39a56..12249a004b0 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -533,7 +533,7 @@ print_scalar_formatted (const void *valaddr, struct type *type, if (*cp == '\0') cp--; } - strcpy (buf, cp); + strncpy (buf, cp, sizeof (bits)); fputs_filtered (buf, stream); } break;