8231600: Avoid GCC 8 strncpy error in jdk.jdwp.agent
Reviewed-by: cjplummer, amenkov
--- 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);