From 0384ecf4ffd38b989677c11b3f793f632d160fb6 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Tue, 19 Feb 2013 20:05:59 +0000 Subject: Fixed #1621: Handle the case when ICE session cannot create valid checklist git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4357 74dad513-b988-da41-8d7b-12977e46ad98 --- pjnath/src/pjnath/ice_session.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pjnath') diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c index 83199618..81aa8143 100644 --- a/pjnath/src/pjnath/ice_session.c +++ b/pjnath/src/pjnath/ice_session.c @@ -966,6 +966,7 @@ static void sort_checklist(pj_ice_sess *ice, pj_ice_sess_checklist *clist) } } + pj_assert(clist->count > 0); for (i=0; icount-1; ++i) { unsigned j, highest = i; @@ -1690,6 +1691,13 @@ PJ_DEF(pj_status_t) pj_ice_sess_create_check_list( } } + /* This could happen if candidates have no matching address families */ + if (clist->count == 0) { + LOG4((ice->obj_name, "Error: no checklist can be created")); + pj_mutex_unlock(ice->mutex); + return PJ_ENOTFOUND; + } + /* Sort checklist based on priority */ sort_checklist(ice, clist); -- cgit v1.2.3