From 935d80c73f103ee1b9f0c39e799c71008a381a4c Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 19 Jul 2005 09:38:36 +0000 Subject: 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 --- user/unix/groupinfo.c | 2 +- user/unix/userinfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'user') 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 -- cgit v1.2.1