[asterisk-commits] moy: branch moy/mfcr2-1.2 r154141 - /team/moy/mfcr2-1.2/channels/chan_zap.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 3 21:49:17 CST 2008


Author: moy
Date: Mon Nov  3 21:49:17 2008
New Revision: 154141

URL: http://svn.digium.com/view/asterisk?view=rev&rev=154141
Log:
validate max amount of r2links properly

Modified:
    team/moy/mfcr2-1.2/channels/chan_zap.c

Modified: team/moy/mfcr2-1.2/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2-1.2/channels/chan_zap.c?view=diff&rev=154141&r1=154140&r2=154141
==============================================================================
--- team/moy/mfcr2-1.2/channels/chan_zap.c (original)
+++ team/moy/mfcr2-1.2/channels/chan_zap.c Mon Nov  3 21:49:17 2008
@@ -6786,8 +6786,8 @@
 #ifdef HAVE_OPENR2
 static struct zt_mfcr2 *mfcr2_get_context(int id)
 {
-	if ((id < 0) || (id > sizeof(r2links))) {
-		ast_log(LOG_ERROR, "Wah! you surely did not mean to do this\n.");
+	if ((id < 0) || (id >= (sizeof(r2links)/sizeof(r2links[0])))) {
+		ast_log(LOG_ERROR, "No more R2 links available!\n");
 		return NULL;
 	}
 	return &r2links[id];




More information about the asterisk-commits mailing list