[Freeswitch-trunk] [commit] r6841 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Mon Dec 17 15:44:48 EST 2007


Author: mikej
Date: Mon Dec 17 15:44:48 2007
New Revision: 6841

Modified:
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_core.c

Log:
off by 1 error in bounds checks.

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Mon Dec 17 15:44:48 2007
@@ -1073,7 +1073,7 @@
 
 	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;
 	}
 

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Mon Dec 17 15:44:48 2007
@@ -131,7 +131,7 @@
 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;
 	}
 



More information about the Freeswitch-trunk mailing list