Aron Griffis
2007-Jan-29 23:53 UTC
[Xen-devel] Re: [Xen-staging] [xen-unstable] ia64 and ppc: Remove uses of strcpy and strncpy.
Additionally... Xen staging patchbot-unstable wrote: [Mon Jan 29 2007, 10:02:21AM EST]> --- a/xen/arch/ia64/xen/gdbstub.c Mon Jan 29 14:59:42 2007 +0000 > +++ b/xen/arch/ia64/xen/gdbstub.c Mon Jan 29 15:01:33 2007 +0000 > @@ -639,7 +639,7 @@ kgdb_get_reg(int regnum, struct unw_fram > outbuffer[size*2] = 0; > } > else > - strcpy(outbuffer, "E0"); > + strlcpy(outbuffer, "E0", sizeof("E0"));Better to use safe_strcpy here instead of duplicating _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Aron Griffis
2007-Jan-30 00:06 UTC
Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] ia64 and ppc: Remove uses of strcpy and strncpy.
Aron Griffis wrote: [Mon Jan 29 2007, 06:53:57PM EST]> Additionally... > > Xen staging patchbot-unstable wrote: [Mon Jan 29 2007, 10:02:21AM EST] > > --- a/xen/arch/ia64/xen/gdbstub.c Mon Jan 29 14:59:42 2007 +0000 > > +++ b/xen/arch/ia64/xen/gdbstub.c Mon Jan 29 15:01:33 2007 +0000 > > @@ -639,7 +639,7 @@ kgdb_get_reg(int regnum, struct unw_fram > > outbuffer[size*2] = 0; > > } > > else > > - strcpy(outbuffer, "E0"); > > + strlcpy(outbuffer, "E0", sizeof("E0")); > > Better to use safe_strcpy here instead of duplicatingMy mistake here. safe_strcpy uses sizeof(dst) not sizeof(src). Your change seems like the best choice in the absence of strcpy() _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel