summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorPaul Querna <pquerna@apache.org>2005-07-19 09:38:36 +0000
committerPaul Querna <pquerna@apache.org>2005-07-19 09:38:36 +0000
commit935d80c73f103ee1b9f0c39e799c71008a381a4c (patch)
tree3778e26602fb947131a1104b58dbbc8175070667 /user
parent8b7bb8d9f60e6a30a8a5b1aad7d2ea99c518d248 (diff)
downloadapr-935d80c73f103ee1b9f0c39e799c71008a381a4c.tar.gz
These functions can return no-error, but still contain a NULL entry, on some crazy unix that some people use called Linux.
PR: 34053 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@219635 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'user')
-rw-r--r--user/unix/groupinfo.c2
-rw-r--r--user/unix/userinfo.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c
index 91ef4df0d..819af43ec 100644
--- a/user/unix/groupinfo.c
+++ b/user/unix/groupinfo.c
@@ -37,7 +37,7 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid,
struct group grp;
char grbuf[512];
- if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr)) {
+ if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr) || gr == NULL) {
#else
if ((gr = getgrgid(groupid)) == NULL) {
#endif
diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c
index a15b22184..829a856be 100644
--- a/user/unix/userinfo.c
+++ b/user/unix/userinfo.c
@@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid,
struct passwd pwd;
char pwbuf[PWBUF_SIZE];
- if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) {
+ if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw) || pw == NULL) {
#else
if ((pw = getpwuid(userid)) == NULL) {
#endif