Skip to content

Commit

Permalink
8265757: stack-use-after-scope in perfMemory_posix.cpp get_user_name_…
Browse files Browse the repository at this point in the history
…slow()

Reviewed-by: lfoltan, dcubed
  • Loading branch information
Harold Seigel committed Apr 27, 2021
1 parent e4be968 commit 879a77f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hotspot/os/posix/perfMemory_posix.cpp
Expand Up @@ -527,6 +527,7 @@ static char* get_user_name_slow(int vmid, int nspid, TRAPS) {
// directory search
char* oldest_user = NULL;
time_t oldest_ctime = 0;
char buffer[MAXPATHLEN + 1];
int searchpid;
char* tmpdirname = (char *)os::get_temp_directory();
#if defined(LINUX)
Expand All @@ -537,7 +538,6 @@ static char* get_user_name_slow(int vmid, int nspid, TRAPS) {
if (nspid == -1) {
searchpid = vmid;
} else {
char buffer[MAXPATHLEN + 1];
jio_snprintf(buffer, MAXPATHLEN, "/proc/%d/root%s", vmid, tmpdirname);
tmpdirname = buffer;
searchpid = nspid;
Expand Down

1 comment on commit 879a77f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.