about summary refs log tree commit diff
path: root/nscd/nscd_getgr_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd_getgr_r.c')
-rw-r--r--nscd/nscd_getgr_r.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c
index 9b3022c764..85ebb0dc60 100644
--- a/nscd/nscd_getgr_r.c
+++ b/nscd/nscd_getgr_r.c
@@ -232,7 +232,18 @@ __nscd_getgr_r (const char *key, request_type type, struct group *resultbuf,
 	      *p++ = '\0';
 	    }
 
-	  if (__readv (sock, vec, gr_resp.gr_mem_len) != total_len)
+	  while (i > UIO_MAXIOV)
+	    {
+	      if (__readv (sock, vec, UIO_MAXIOV) != total_len)
+		{
+		  __close (sock);
+		  return -1;
+		}
+	      vec += UIO_MAXIOV;
+	      i -= UIO_MAXIOV;
+	    }
+
+	  if (__readv (sock, vec, i) != total_len)
 	    {
 	      __close (sock);
 	      return -1;