lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1782 - in nss-pam-ldapd-0.7: . common

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1782 - in nss-pam-ldapd-0.7: . common



Author: arthur
Date: Fri Oct 12 17:29:16 2012
New Revision: 1782
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1782&view=revision

Log:
check if the file descriptor can be stored in the select() file descriptor set 
(r1781 from 0.8)

Modified:
   nss-pam-ldapd-0.7/   (props changed)
   nss-pam-ldapd-0.7/common/tio.c

Modified: nss-pam-ldapd-0.7/common/tio.c
==============================================================================
--- nss-pam-ldapd-0.7/common/tio.c      Fri Oct 12 17:25:26 2012        (r1781)
+++ nss-pam-ldapd-0.7/common/tio.c      Fri Oct 12 17:29:16 2012        (r1782)
@@ -184,6 +184,11 @@
   while (1)
   {
     /* prepare our filedescriptorset */
+    if (fp->fd>=FD_SETSIZE)
+    {
+      errno=EBADFD;
+      return -1;
+    }
     FD_ZERO(&fdset);
     FD_SET(fp->fd,&fdset);
     /* figure out the time we need to wait */
@@ -397,6 +402,11 @@
   fd_set fdset;
   int rv;
   /* prepare our filedescriptorset */
+  if (fp->fd>=FD_SETSIZE)
+  {
+    errno=EBADFD;
+    return -1;
+  }
   FD_ZERO(&fdset);
   FD_SET(fp->fd,&fdset);
   /* set the timeout to 0 to poll */
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/