changeset 1714:96d554193f72

6944822: Fix for 6938627 exposes problem with hard-coded buffer sizes Summary: Make tmpdir buffer sizes MAX_PATH+1 Reviewed-by: dholmes, coleenp Contributed-by: andreas.kohn@fredhopper.com
author coleenp
date Mon, 19 Apr 2010 18:58:31 -0400
parents 6ccd32c284ac
children 77261afdc5f2
files src/os/linux/vm/attachListener_linux.cpp src/os/linux/vm/os_linux.cpp src/os/solaris/vm/attachListener_solaris.cpp
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/linux/vm/attachListener_linux.cpp	Wed Apr 07 12:28:22 2010 -0400
+++ b/src/os/linux/vm/attachListener_linux.cpp	Mon Apr 19 18:58:31 2010 -0400
@@ -461,7 +461,7 @@
   if (init_at_startup() || is_initialized()) {
     return false;               // initialized at startup or already initialized
   }
-  char fn[128];
+  char fn[PATH_MAX+1];
   sprintf(fn, ".attach_pid%d", os::current_process_id());
   int ret;
   struct stat64 st;
--- a/src/os/linux/vm/os_linux.cpp	Wed Apr 07 12:28:22 2010 -0400
+++ b/src/os/linux/vm/os_linux.cpp	Mon Apr 19 18:58:31 2010 -0400
@@ -2305,7 +2305,7 @@
     return;
   }
 
-  char buf[40];
+  char buf[PATH_MAX+1];
   int num = Atomic::add(1, &cnt);
 
   snprintf(buf, sizeof(buf), "%s/hs-vm-%d-%d",
--- a/src/os/solaris/vm/attachListener_solaris.cpp	Wed Apr 07 12:28:22 2010 -0400
+++ b/src/os/solaris/vm/attachListener_solaris.cpp	Mon Apr 19 18:58:31 2010 -0400
@@ -592,7 +592,7 @@
   if (init_at_startup() || is_initialized()) {
     return false;               // initialized at startup or already initialized
   }
-  char fn[128];
+  char fn[PATH_MAX+1];
   sprintf(fn, ".attach_pid%d", os::current_process_id());
   int ret;
   struct stat64 st;