hotspot/src/os/aix/vm/os_aix.cpp
changeset 27471 6e56277909f1
parent 27400 c5955f4b7c84
child 27474 2b061fd571eb
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Mon Nov 03 11:34:13 2014 -0800
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Wed Oct 29 10:13:24 2014 +0100
@@ -1641,7 +1641,8 @@
   char* rp = realpath((char *)dlinfo.dli_fname, buf);
   assert(rp != NULL, "error in realpath(): maybe the 'path' argument is too long?");
 
-  strcpy(saved_jvm_path, buf);
+  strncpy(saved_jvm_path, buf, sizeof(saved_jvm_path));
+  saved_jvm_path[sizeof(saved_jvm_path) - 1] = '\0';
 }
 
 void os::print_jni_name_prefix_on(outputStream* st, int args_size) {