]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2275] fix strncpy in socketrequestortest
authorJelte Jansen <jelte@isc.org>
Mon, 8 Oct 2012 07:41:11 +0000 (09:41 +0200)
committerJelte Jansen <jelte@isc.org>
Mon, 8 Oct 2012 07:41:11 +0000 (09:41 +0200)
src/lib/server_common/tests/socket_requestor_test.cc

index 1ee9178e7c13451cda6f3b4d5c7ae67bff8ebc5a..ac1731f3daf35cafdb6b059a1400bcdfa8d6564c 100644 (file)
@@ -410,8 +410,8 @@ private:
             isc_throw(Unexpected,
                       "mkstemp() created a filename too long for sun_path");
         }
-        memset(socket_address.sun_path, 0, sizeof(socket_address.sun_path));
-        strncpy(socket_address.sun_path, path_, len);
+        strncpy(socket_address.sun_path, path_,
+                sizeof(socket_address.sun_path));
 #ifdef HAVE_SA_LEN
         socket_address.sun_len = len;
 #endif