6944822: Fix for 6938627 exposes problem with hard-coded buffer sizes

Mon, 19 Apr 2010 18:58:31 -0400

author
coleenp
date
Mon, 19 Apr 2010 18:58:31 -0400
changeset 1852
96d554193f72
parent 1790
6ccd32c284ac
child 1853
77261afdc5f2

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

src/os/linux/vm/attachListener_linux.cpp file | annotate | diff | comparison | revisions
src/os/linux/vm/os_linux.cpp file | annotate | diff | comparison | revisions
src/os/solaris/vm/attachListener_solaris.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/os/linux/vm/attachListener_linux.cpp	Wed Apr 07 12:28:22 2010 -0400
     1.2 +++ b/src/os/linux/vm/attachListener_linux.cpp	Mon Apr 19 18:58:31 2010 -0400
     1.3 @@ -461,7 +461,7 @@
     1.4    if (init_at_startup() || is_initialized()) {
     1.5      return false;               // initialized at startup or already initialized
     1.6    }
     1.7 -  char fn[128];
     1.8 +  char fn[PATH_MAX+1];
     1.9    sprintf(fn, ".attach_pid%d", os::current_process_id());
    1.10    int ret;
    1.11    struct stat64 st;
     2.1 --- a/src/os/linux/vm/os_linux.cpp	Wed Apr 07 12:28:22 2010 -0400
     2.2 +++ b/src/os/linux/vm/os_linux.cpp	Mon Apr 19 18:58:31 2010 -0400
     2.3 @@ -2305,7 +2305,7 @@
     2.4      return;
     2.5    }
     2.6  
     2.7 -  char buf[40];
     2.8 +  char buf[PATH_MAX+1];
     2.9    int num = Atomic::add(1, &cnt);
    2.10  
    2.11    snprintf(buf, sizeof(buf), "%s/hs-vm-%d-%d",
     3.1 --- a/src/os/solaris/vm/attachListener_solaris.cpp	Wed Apr 07 12:28:22 2010 -0400
     3.2 +++ b/src/os/solaris/vm/attachListener_solaris.cpp	Mon Apr 19 18:58:31 2010 -0400
     3.3 @@ -592,7 +592,7 @@
     3.4    if (init_at_startup() || is_initialized()) {
     3.5      return false;               // initialized at startup or already initialized
     3.6    }
     3.7 -  char fn[128];
     3.8 +  char fn[PATH_MAX+1];
     3.9    sprintf(fn, ".attach_pid%d", os::current_process_id());
    3.10    int ret;
    3.11    struct stat64 st;

mercurial