Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8259786: initialize last parameter of getpwuid_r
Reviewed-by: mdoerr, hseigel
  • Loading branch information
MBaesken committed Jan 20, 2021
1 parent 70b5b31 commit 52ed2aab9b9d81f0fb0584566c6e650f44f955d6
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/hotspot/os/posix/perfMemory_posix.cpp
  2. +2 −2 src/jdk.security.auth/unix/native/libjaas/Unix.c
@@ -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') {
@@ -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
@@ -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;

0 comments on commit 52ed2aa

Please sign in to comment.