aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-04-18 14:52:07 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-04-18 14:52:07 +0000
commit77c45b121e815ab2a107f1e3e6f6b737da770d2a (patch)
tree97132f7b965b7e48981b90ede0400c04eb8f14b3 /winsup/cygwin
parent4199e1e6fb0ec02c3da3983da88e633dc19a6841 (diff)
downloadnewlib-77c45b121e815ab2a107f1e3e6f6b737da770d2a.zip
newlib-77c45b121e815ab2a107f1e3e6f6b737da770d2a.tar.gz
newlib-77c45b121e815ab2a107f1e3e6f6b737da770d2a.tar.bz2
* grp.cc (getgroups): Avoid crash if passwd field if /etc/group is
empty.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/grp.cc3
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index bb52a53..a60d336 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-18 Egor Duda <deo@logos-m.ru>
+
+ * grp.cc (getgroups): Avoid crash if passwd field if /etc/group is
+ empty.
+
Tue Apr 17 19:05:44 2001 Christopher Faylor <cgf@cygnus.com>
* path.h (path_conv::add_ext_from_sym): Declare.
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index bfea599..d3431a3 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;