diff src/os/windows/vm/os_windows.cpp @ 17595:3eed8712d410

Merge with jdk8u11-b12
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 12:09:28 +0200
parents 534439756990 5656140324ed
children 52b4284cb496
line wrap: on
line diff
--- a/src/os/windows/vm/os_windows.cpp	Wed Oct 15 12:04:20 2014 +0200
+++ b/src/os/windows/vm/os_windows.cpp	Wed Oct 15 12:09:28 2014 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1819,7 +1819,8 @@
      // libjvm.so is installed there (append a fake suffix
      // hotspot/libjvm.so).
      char* java_home_var = ::getenv("JAVA_HOME");
-     if (java_home_var != NULL && java_home_var[0] != 0) {
+     if (java_home_var != NULL && java_home_var[0] != 0 &&
+         strlen(java_home_var) < (size_t)buflen) {
 
         strncpy(buf, java_home_var, buflen);
 
@@ -1837,9 +1838,9 @@
   }
 
   if(buf[0] == '\0') {
-  GetModuleFileName(vm_lib_handle, buf, buflen);
-  }
-  strcpy(saved_jvm_path, buf);
+    GetModuleFileName(vm_lib_handle, buf, buflen);
+  }
+  strncpy(saved_jvm_path, buf, MAX_PATH);
 }
 
 
@@ -2303,19 +2304,8 @@
       }
 
 */
-#endif //_WIN64
-
-
-// Fatal error reporting is single threaded so we can make this a
-// static and preallocated.  If it's more than MAX_PATH silently ignore
-// it.
-static char saved_error_file[MAX_PATH] = {0};
-
-void os::set_error_file(const char *logfile) {
-  if (strlen(logfile) <= MAX_PATH) {
-    strncpy(saved_error_file, logfile, MAX_PATH);
-  }
-}
+#endif // _WIN64
+
 
 static inline void report_error(Thread* t, DWORD exception_code,
                                 address addr, void* siginfo, void* context) {