diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2008-04-05 15:35:25 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2008-04-05 15:35:25 +0200 |
commit | 396968ab92342b66a5da6e8852204f201bcc547b (patch) | |
tree | c1395c2680787037d3579ee67f5d1d5ac7823140 /nss | |
parent | 6d5fa87e508b78b404352e0a70cccd665f1d9e97 (diff) |
properly check the limit (as seen in nis-initgroups.c)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@658 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss')
-rw-r--r-- | nss/group.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nss/group.c b/nss/group.c index 3ab875d..d552ccf 100644 --- a/nss/group.c +++ b/nss/group.c @@ -64,8 +64,11 @@ static enum nss_status read_gids( READ_TYPE(fp,gid,gid_t); /* skip members */ SKIP_STRINGLIST(fp); + /* check if we reached the limit */ + if ( (limit>0) && (*size>=limit) ) + return NSS_STATUS_SUCCESS; /* check if entry would fit and we have not returned too many */ - if ( ((*start)>=(*size)) || (num>=limit) ) + if ((*start)>=(*size)) { ERROR_OUT_BUFERROR(fp); } /* add gid to list */ (*groupsp)[(*start)++]=gid; |