summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/getgrent.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 8c60361..a13e7c3 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -239,8 +239,16 @@ grscan(search, gid, name)
* past this point under certain circumstances or
* we risk dereferencing null pointers down below.
*/
- if (!search && _gr_group.gr_name[0] == '+')
- return(1);
+ if (_gr_group.gr_name[0] == '+') {
+ switch(search) {
+ case 0:
+ return(1);
+ case 1:
+ return(0);
+ default:
+ return(0);
+ }
+ }
#endif /* YP */
_gr_group.gr_passwd = strsep(&bp, ":\n");
if (!(cp = strsep(&bp, ":\n")))
OpenPOWER on IntegriCloud