8231600: Avoid GCC 8 strncpy error in jdk.jdwp.agent
authorfweimer
Sat, 28 Sep 2019 11:04:01 +0200
changeset 58433 a7c95e2f8814
parent 58431 c8b0dcab20d7
child 58436 91d236715160
8231600: Avoid GCC 8 strncpy error in jdk.jdwp.agent Reviewed-by: cjplummer, amenkov
src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c
--- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c	Tue Oct 01 08:11:02 2019 -0700
+++ b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c	Sat Sep 28 11:04:01 2019 +0200
@@ -511,7 +511,7 @@
     if (buffer == NULL) {
         RETURN_ERROR(JDWPTRANSPORT_ERROR_OUT_OF_MEMORY, "out of memory");
     }
-    strncpy(buffer, allowed_peers, len);
+    memcpy(buffer, allowed_peers, len);
     buffer[len] = '\0';
 
     jdwpTransportError err = parseAllowedPeersInternal(buffer);