Use memcpy rather than strncpy in sk_addrcopy! How did that happen?
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 20 Sep 2002 17:54:17 +0000 (17:54 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 20 Sep 2002 17:54:17 +0000 (17:54 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@1968 cda61777-01e9-0310-a592-d414129be87e

winnet.c

index 5b853e1..7cadf86 100644 (file)
--- 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
 }