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:
Michael Jerris 2007-12-17 20:44:48 +00:00
parent 523c0bd845
commit 171f02c9ad
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}