Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss
diff options
context:
space:
mode:
Diffstat (limited to 'nss')
-rw-r--r--nss/group.c5
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;