[illumos-Developer] webrev #953 amd64 mdb chews arguments to ::run?

Dan McDonald danmcd at nexenta.com
Mon May 16 06:48:36 PDT 2011


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.

Which addresses my concerns about whether or not we should be looking at the
str*() functions themselves.  Phew!

Ship it!

Thanks,
Dan



More information about the Developer mailing list