* grp.cc (getgroups): Avoid crash if passwd field if /etc/group is
empty.
This commit is contained in:
parent
4199e1e6fb
commit
77c45b121e
|
@ -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>
|
Tue Apr 17 19:05:44 2001 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* path.h (path_conv::add_ext_from_sym): Declare.
|
* path.h (path_conv::add_ext_from_sym): Declare.
|
||||||
|
|
|
@ -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);
|
convert_sid_to_string_sid (groups->Groups[pg].Sid, ssid);
|
||||||
for (int gg = 0; gg < curr_lines; ++gg)
|
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)
|
if (cnt < gidsetsize)
|
||||||
grouplist[cnt] = group_buf[gg].gr_gid;
|
grouplist[cnt] = group_buf[gg].gr_gid;
|
||||||
|
|
Loading…
Reference in New Issue