diff options
author | Benny Prijono <bennylp@teluu.com> | 2013-02-19 20:05:59 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2013-02-19 20:05:59 +0000 |
commit | 0384ecf4ffd38b989677c11b3f793f632d160fb6 (patch) | |
tree | 9ec7e09f0e3cce6f74d491c9ba24f2929495a5b8 /pjnath | |
parent | 63228a02f45b889e2e0d2c799b098a13ad4f464f (diff) |
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
Diffstat (limited to 'pjnath')
-rw-r--r-- | pjnath/src/pjnath/ice_session.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; i<clist->count-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); |