This condition should NEVER be hit, but in case the started thread is unable to locate itself in the EVENT_DISOATCH_QUEUE_THREADS array, it's best to return null here and kill the unexpected event thread rather than segfault FS by writing outside of the bounds of the EVENT_DISPATCH_QUEUE_RUNNING array.
This commit is contained in:
parent
50b664c2dd
commit
e5ca2a0028
|
@ -26,7 +26,7 @@
|
|||
* Anthony Minessale II <anthm@freeswitch.org>
|
||||
* Michael Jerris <mike@jerris.com>
|
||||
* Paul D. Tinsley <pdt at jackhammer.org>
|
||||
*
|
||||
* William King <william.king@quentustech.com>
|
||||
*
|
||||
* switch_event.c -- Event System
|
||||
*
|
||||
|
@ -254,6 +254,10 @@ static void *SWITCH_THREAD_FUNC switch_event_dispatch_thread(switch_thread_t *th
|
|||
}
|
||||
}
|
||||
|
||||
if ( my_id >= MAX_DISPATCH_VAL ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EVENT_DISPATCH_QUEUE_RUNNING[my_id] = 1;
|
||||
switch_mutex_unlock(EVENT_QUEUE_MUTEX);
|
||||
|
||||
|
|
Loading…
Reference in New Issue