From: Kurt Zeilenga Date: Tue, 2 Mar 1999 21:06:42 +0000 (+0000) Subject: Add protect against new connection descriptor being to large for X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~522 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aa3803578092045ad034454f4816a56a5f23450f;p=openldap Add protect against new connection descriptor being to large for our connection table. --- diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 25ff2c1cac..807b705d87 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -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 );