Skip to content

Commit

Permalink
8259786: initialize last parameter of getpwuid_r
Browse files Browse the repository at this point in the history
Reviewed-by: mdoerr, hseigel
  • Loading branch information
MBaesken committed Jan 20, 2021
1 parent 70b5b31 commit 52ed2aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/os/posix/perfMemory_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static char* get_user_name(uid_t uid) {

char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);

struct passwd* p;
struct passwd* p = NULL;
int result = getpwuid_r(uid, &pwent, pwbuf, (size_t)bufsize, &p);

if (result != 0 || p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') {
Expand Down
4 changes: 2 additions & 2 deletions src/jdk.security.auth/unix/native/libjaas/Unix.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, 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
Expand Down Expand Up @@ -45,7 +45,7 @@ Java_com_sun_security_auth_module_UnixSystem_getUnixInfo

int i;
char pwd_buf[1024];
struct passwd *pwd;
struct passwd *pwd = NULL;
struct passwd resbuf;
jfieldID userNameID;
jfieldID userID;
Expand Down

1 comment on commit 52ed2aa

@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.