hotspot/src/os/linux/vm/os_linux.cpp
changeset 25503 9f471b837330
parent 25477 7dad9f95fd31
child 25946 1572c9f03fb9
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Fri Jul 11 09:14:21 2014 -0700
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Mon Jul 14 12:43:50 2014 +0400
@@ -1553,9 +1553,6 @@
   ::abort();
 }
 
-// unused on linux for now.
-void os::set_error_file(const char *logfile) {}
-
 
 // This method is a copy of JDK's sysGetLastErrorString
 // from src/solaris/hpi/src/system_md.c
@@ -2345,6 +2342,7 @@
         // determine if this is a legacy image or modules image
         // modules image doesn't have "jre" subdirectory
         len = strlen(buf);
+        assert(len < buflen, "Ran out of buffer room");
         jrelib_p = buf + len;
         snprintf(jrelib_p, buflen-len, "/jre/lib/%s", cpu_arch);
         if (0 != access(buf, F_OK)) {
@@ -2365,7 +2363,7 @@
     }
   }
 
-  strcpy(saved_jvm_path, buf);
+  strncpy(saved_jvm_path, buf, MAXPATHLEN);
 }
 
 void os::print_jni_name_prefix_on(outputStream* st, int args_size) {