From dfbd32d6c8dae41cb82f2e276b9634f927362e02 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 11 Aug 2008 15:17:40 +0000 Subject: Ticket #591: Assertion failure in ICE session (thanks Pedro Gonçalves for the report) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2202 74dad513-b988-da41-8d7b-12977e46ad98 --- pjnath/src/pjnath/ice_session.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c index 71d91bba..77deed5a 100644 --- a/pjnath/src/pjnath/ice_session.c +++ b/pjnath/src/pjnath/ice_session.c @@ -1636,6 +1636,9 @@ PJ_DEF(pj_status_t) pj_ice_sess_start_check(pj_ice_sess *ice) /* Checklist must have been created */ PJ_ASSERT_RETURN(ice->clist.count > 0, PJ_EINVALIDOP); + /* Lock session */ + pj_mutex_lock(ice->mutex); + LOG4((ice->obj_name, "Starting ICE check..")); /* The agent examines the check list for the first media stream (a @@ -1659,6 +1662,7 @@ PJ_DEF(pj_status_t) pj_ice_sess_start_check(pj_ice_sess *ice) } if (i == clist->count) { pj_assert(!"Unable to find checklist for component 1"); + pj_mutex_unlock(ice->mutex); return PJNATH_EICEINCOMPID; } @@ -1710,6 +1714,7 @@ PJ_DEF(pj_status_t) pj_ice_sess_start_check(pj_ice_sess *ice) clist->timer.id = PJ_FALSE; } + pj_mutex_unlock(ice->mutex); return status; } @@ -2191,6 +2196,13 @@ static void handle_incoming_check(pj_ice_sess *ice, * candidate. */ if (i == ice->rcand_cnt) { + if (ice->rcand_cnt >= PJ_ICE_MAX_CAND) { + LOG4((ice->obj_name, + "Unable to add new peer reflexive candidate: too many " + "candidates already (%d)", PJ_ICE_MAX_CAND)); + return; + } + rcand = &ice->rcand[ice->rcand_cnt++]; rcand->comp_id = (pj_uint8_t)rcheck->comp_id; rcand->type = PJ_ICE_CAND_TYPE_PRFLX; -- cgit v1.2.3