[illumos-Developer] webrev #953 amd64 mdb chews arguments to ::run?
Yuri Pankov
yuri.pankov at gmail.com
Mon May 16 06:56:52 PDT 2011
On Mon, May 16, 2011 at 09:48:36AM -0400, Dan McDonald wrote:
> On Mon, May 16, 2011 at 12:38:21PM +0400, Alexander Eremin wrote:
> > This fix replaces strncpy/strcpy, which in 64bit mode affected for
> > overlap, with memmove.
>
> Odd that this would only manifest on 64-bit, but...
>
> > webrev: http://cr.opensolaris.org/~alhazred/i953/
>
> ... this certainly addresses the fix in the short-term.
>
> I just RTFM and noticed:
>
> strcpy(), strncpy(), strlcpy()
> The strcpy() function copies string s2 to s1, including the
> terminating null character, stopping after the null charac-
> ter has been copied. The strncpy() function copies exactly n
> bytes, truncating s2 or adding null characters to s1 if
> necessary. The result will not be null-terminated if the
> length of s2 is n or more. Each function returns s1. If
> copying takes place between objects that overlap, the
> behavior of strcpy(), strncpy(), and strlcpy() is undefined.
This quote doesn't include the strlcpy() description, which definitely
looks like a candidate to be used here.
>
> Which addresses my concerns about whether or not we should be looking at the
> str*() functions themselves. Phew!
>
> Ship it!
Yuri
More information about the Developer
mailing list