OSSP CVS Repository

ossp - Check-in [2632]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2632
Date: 2002-Oct-20 19:49:03 (local)
2002-Oct-20 17:49:03 (UTC)
User:rse
Branch:
Comment: add extra sanity check for nfds in pth_select
Tickets:
Inspections:
Files:
ossp-pkg/pth/pth_high.c      1.87 -> 1.88     4 inserted, 0 deleted

ossp-pkg/pth/pth_high.c 1.87 -> 1.88

--- pth_high.c   2002/10/20 16:19:39     1.87
+++ pth_high.c   2002/10/20 17:49:03     1.88
@@ -258,6 +258,10 @@
     pth_implicit_init();
     pth_debug2("pth_select_ev: called from thread \"%s\"", pth_current->name);
 
+    /* sanity checking */
+    if (!pth_util_fd_valid(nfd-1))
+        return_errno(-1, EINVAL);
+
     /* first deal with the special situation of a plain microsecond delay */
     if (nfd == 0 && rfds == NULL && wfds == NULL && efds == NULL && timeout != NULL) {
         if (timeout->tv_sec < 0 || timeout->tv_usec < 0)

CVSTrac 2.0.1