group_info_gid & group_info_name core dumped when the input parameter was
bogus. Fixed. -Olin
This commit is contained in:
parent
294994dcf2
commit
400bc57c41
|
@ -91,9 +91,9 @@ int group_info_gid (int gid, char **name, char ***members, int *nmembers)
|
||||||
{
|
{
|
||||||
struct group *grp = getgrgid(gid);
|
struct group *grp = getgrgid(gid);
|
||||||
if( !grp ) {
|
if( !grp ) {
|
||||||
name = 0;
|
*name = 0;
|
||||||
members = 0;
|
*members = 0;
|
||||||
nmembers = 0;
|
*nmembers = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*name = grp->gr_name;
|
*name = grp->gr_name;
|
||||||
|
@ -107,9 +107,9 @@ int group_info_name (const char *name,
|
||||||
{
|
{
|
||||||
struct group *grp = getgrnam(name);
|
struct group *grp = getgrnam(name);
|
||||||
if( !grp ) {
|
if( !grp ) {
|
||||||
gid = 0;
|
*gid = 0;
|
||||||
members = 0;
|
*members = 0;
|
||||||
nmembers = 0;
|
*nmembers = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*gid = grp->gr_gid;
|
*gid = grp->gr_gid;
|
||||||
|
|
Loading…
Reference in New Issue