Add protect against new connection descriptor being to large for

our connection table.
This commit is contained in:
Kurt Zeilenga 1999-03-02 21:06:42 +00:00
parent fdc44bf313
commit aa38035780

View 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 );