Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-04-18 18:52:07 +0400
committerCorinna Vinschen <corinna@vinschen.de>2001-04-18 18:52:07 +0400
commit77c45b121e815ab2a107f1e3e6f6b737da770d2a (patch)
tree97132f7b965b7e48981b90ede0400c04eb8f14b3 /winsup/cygwin/grp.cc
parent4199e1e6fb0ec02c3da3983da88e633dc19a6841 (diff)
* grp.cc (getgroups): Avoid crash if passwd field if /etc/group is
empty.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index bfea59998..d3431a37f 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -260,7 +260,8 @@ getgroups (int gidsetsize, gid_t *grouplist, gid_t gid, const char *username)
convert_sid_to_string_sid (groups->Groups[pg].Sid, ssid);
for (int gg = 0; gg < curr_lines; ++gg)
{
- if (!strcmp (group_buf[gg].gr_passwd, ssid))
+ if (group_buf[gg].gr_passwd &&
+ !strcmp (group_buf[gg].gr_passwd, ssid))
{
if (cnt < gidsetsize)
grouplist[cnt] = group_buf[gg].gr_gid;