]> git.sur5r.net Git - openldap/commitdiff
Add protect against new connection descriptor being to large for
authorKurt Zeilenga <kurt@openldap.org>
Tue, 2 Mar 1999 21:06:42 +0000 (21:06 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 2 Mar 1999 21:06:42 +0000 (21:06 +0000)
our connection table.

servers/slapd/daemon.c

index 25ff2c1cacf1648fbd99bbd266e525a770f75ad4..807b705d875c0acb923294b667f96468d016e90b 100644 (file)
@@ -233,6 +233,16 @@ slapd_daemon(
                                ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
                                continue;
                        }
+
+                       /* make sure descriptor number isn't too great */
+                       if ( ns >= dtblsize ) {
+                               Debug( LDAP_DEBUG_ANY,
+                                       "new connection on %d beyond descriptor table size %d\n",
+                                       ns, dtblsize, 0 );
+                               close(ns);
+                               ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
+                               continue;
+                       }
                   
                        lber_pvt_sb_set_desc( &c[ns].c_sb, ns );
                        lber_pvt_sb_set_io( &c[ns].c_sb, &lber_pvt_sb_io_tcp, NULL );