From 9f0364df60acf729c44c04ddc1b7ddc795cefb1b Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Sat, 24 Jul 2010 10:40:55 +0000 Subject: [PATCH] lib - sanity check for group_from_gid etc. --- lib/libc/other/pwcache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libc/other/pwcache.c b/lib/libc/other/pwcache.c index bf3f366d9..0505e46c4 100644 --- a/lib/libc/other/pwcache.c +++ b/lib/libc/other/pwcache.c @@ -271,7 +271,8 @@ user_from_uid(uid_t uid, int noname) if ((uidtb == NULL) && (uidtb_start() < 0)) return (NULL); - + if (uid < 0) + return NULL; /* * 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)) return (NULL); + if (gid < 0) + return NULL; /* * see if we have this gid cached -- 2.44.0