From: Simon Tatham Date: Fri, 20 Sep 2002 17:54:17 +0000 (+0000) Subject: Use memcpy rather than strncpy in sk_addrcopy! How did that happen? X-Git-Tag: r8855-g4f798d~2192 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=01fae0422c5eebdea26f974d8f632195b43e8e5f;p=PuTTY_svn.git Use memcpy rather than strncpy in sk_addrcopy! How did that happen? git-svn-id: http://svn.tartarus.org/sgt/putty@1968 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/winnet.c b/winnet.c index 5b853e10..7cadf86f 100644 --- a/winnet.c +++ b/winnet.c @@ -380,10 +380,10 @@ void sk_addrcopy(SockAddr addr, char *buf) #endif struct in_addr a; a.s_addr = htonl(addr->address); - strncpy(buf, (char*) &a.s_addr, 4); + memcpy(buf, (char*) &a.s_addr, 4); #ifdef IPV6 } else { - strncpy(buf, (char*) addr->ai, 16); + memcpy(buf, (char*) addr->ai, 16); } #endif }