mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
ldap_int_thread_pool_wrapper was called with wrong prototype (ITS#1673)
================
Written by Hallvard B. Furuseth and placed into the public domain.
This software is not subject to any license of the University of Oslo.
================
ldap_int_thread_pool_wrapper() was defined with an parameter
struct ldap_int_thread_pool_s* but called with a void* argument.
Since these may have different representations, it can crash.
Hallvard B. Furuseth <h.b.furuseth@usit.uio.no>, March 2002.
This commit is contained in:
parent
f11a682c6f
commit
e8c5f59d84
1 changed files with 5 additions and 6 deletions
|
|
@ -60,8 +60,7 @@ static LDAP_STAILQ_HEAD(tpq, ldap_int_thread_pool_s)
|
|||
|
||||
static ldap_pvt_thread_mutex_t ldap_pvt_thread_pool_mutex;
|
||||
|
||||
static void *ldap_int_thread_pool_wrapper(
|
||||
struct ldap_int_thread_pool_s *pool );
|
||||
static void *ldap_int_thread_pool_wrapper( void *pool );
|
||||
|
||||
int
|
||||
ldap_int_thread_pool_startup ( void )
|
||||
|
|
@ -130,8 +129,7 @@ ldap_pvt_thread_pool_init (
|
|||
pool->ltp_open_count++;
|
||||
|
||||
ldap_pvt_thread_t thr;
|
||||
rc = ldap_pvt_thread_create( &thr, 1,
|
||||
(void *) ldap_int_thread_pool_wrapper, pool );
|
||||
rc = ldap_pvt_thread_create( &thr, 1, ldap_int_thread_pool_wrapper, pool );
|
||||
|
||||
if( rc != 0) {
|
||||
/* couldn't start one? then don't start any */
|
||||
|
|
@ -208,7 +206,7 @@ ldap_pvt_thread_pool_submit (
|
|||
|
||||
if (need_thread) {
|
||||
int rc = ldap_pvt_thread_create( &thr, 1,
|
||||
(void *)ldap_int_thread_pool_wrapper, pool );
|
||||
ldap_int_thread_pool_wrapper, pool );
|
||||
ldap_pvt_thread_mutex_lock(&pool->ltp_mutex);
|
||||
if (rc == 0) {
|
||||
pool->ltp_starting--;
|
||||
|
|
@ -353,8 +351,9 @@ ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending )
|
|||
|
||||
static void *
|
||||
ldap_int_thread_pool_wrapper (
|
||||
struct ldap_int_thread_pool_s *pool )
|
||||
void *xpool )
|
||||
{
|
||||
struct ldap_int_thread_pool_s *pool = xpool;
|
||||
ldap_int_thread_ctx_t *ctx;
|
||||
|
||||
if (pool == NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue