From: Anthony Minessale Date: Fri, 31 Jul 2009 15:45:38 +0000 (+0000) Subject: add error check condition for invalid channel selection X-Git-Tag: v1.0.6~38^2~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5b1fa667dc8a768c64b9666e57737801e6e0ade;p=thirdparty%2Ffreeswitch.git add error check condition for invalid channel selection git-svn-id: http://svn.openzap.org/svn/openzap/trunk@787 a93c3328-9c30-0410-af19-c9cd2b2d52af --- diff --git a/libs/openzap/src/zap_io.c b/libs/openzap/src/zap_io.c index 8e5b9381c6..4b62dd3153 100644 --- a/libs/openzap/src/zap_io.c +++ b/libs/openzap/src/zap_io.c @@ -1122,7 +1122,11 @@ OZ_DECLARE(zap_status_t) zap_channel_open(uint32_t span_id, uint32_t chan_id, za goto done; } - check = span->channels[chan_id]; + if (!(check = span->channels[chan_id])) { + zap_log(ZAP_LOG_ERROR, "Invalid Channel %d\n", chan_id); + *zchan = NULL; + goto done; + } if (zap_test_flag(check, ZAP_CHANNEL_SUSPENDED) || !zap_test_flag(check, ZAP_CHANNEL_READY) || (status = zap_mutex_trylock(check->mutex)) != ZAP_SUCCESS) {