off by 1 error in bounds checks.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6841 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
523c0bd845
commit
171f02c9ad
|
@ -1073,7 +1073,7 @@ SWITCH_DECLARE(const switch_state_handler_table_t *) switch_channel_get_state_ha
|
|||
|
||||
switch_assert(channel != NULL);
|
||||
|
||||
if (index > SWITCH_MAX_STATE_HANDLERS || index > channel->state_handler_index) {
|
||||
if (index >= SWITCH_MAX_STATE_HANDLERS || index > channel->state_handler_index) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ SWITCH_DECLARE(int) switch_core_add_state_handler(const switch_state_handler_tab
|
|||
SWITCH_DECLARE(const switch_state_handler_table_t *) switch_core_get_state_handler(int index)
|
||||
{
|
||||
|
||||
if (index > SWITCH_MAX_STATE_HANDLERS || index > runtime.state_handler_index) {
|
||||
if (index >= SWITCH_MAX_STATE_HANDLERS || index > runtime.state_handler_index) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue