Date: Sat, 24 Jan 2015 21:05:18 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277659 - head/contrib/gdb/gdb Message-ID: <201501242105.t0OL5IYq094103@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Sat Jan 24 21:05:18 2015 New Revision: 277659 URL: https://svnweb.freebsd.org/changeset/base/277659 Log: MFV r277658: GDB: Replace use of sprintf. 2005-03-17 Mark Kettenis <kettenis@gnu.org> * corelow.c (get_core_register_section): Replace usage of sprintf and strcpy with xstrprintf and xstrdup. Sourceware commit: 3ecda4574edb38ad12fb491ccaf6d9b0caa3a07a CID: 1006819 MFC after: 4 days Modified: head/contrib/gdb/gdb/corelow.c Directory Properties: head/contrib/gdb/ (props changed) Modified: head/contrib/gdb/gdb/corelow.c ============================================================================== --- head/contrib/gdb/gdb/corelow.c Sat Jan 24 21:00:51 2015 (r277658) +++ head/contrib/gdb/gdb/corelow.c Sat Jan 24 21:05:18 2015 (r277659) @@ -432,15 +432,16 @@ get_core_register_section (char *name, char *human_name, int required) { - char section_name[100]; + static char *section_name = NULL; struct bfd_section *section; bfd_size_type size; char *contents; + xfree (section_name); if (PIDGET (inferior_ptid)) - sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid)); + section_name = xstrprintf ("%s/%d", name, PIDGET (inferior_ptid)); else - strcpy (section_name, name); + section_name = xstrdup (name); section = bfd_get_section_by_name (core_bfd, section_name); if (! section)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501242105.t0OL5IYq094103>