lib - sanity check for group_from_gid etc.

This commit is contained in:
Ben Gras 2010-07-24 10:40:55 +00:00
parent df0ba02a38
commit 9f0364df60

View file

@ -271,7 +271,8 @@ user_from_uid(uid_t uid, int noname)
if ((uidtb == NULL) && (uidtb_start() < 0)) if ((uidtb == NULL) && (uidtb_start() < 0))
return (NULL); return (NULL);
if (uid < 0)
return NULL;
/* /*
* see if we have this uid cached * see if we have this uid cached
*/ */
@ -342,6 +343,8 @@ group_from_gid(gid_t gid, int noname)
if ((gidtb == NULL) && (gidtb_start() < 0)) if ((gidtb == NULL) && (gidtb_start() < 0))
return (NULL); return (NULL);
if (gid < 0)
return NULL;
/* /*
* see if we have this gid cached * see if we have this gid cached