summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2011-07-07 04:35:00 +0000
committerBenny Prijono <bennylp@teluu.com>2011-07-07 04:35:00 +0000
commit5868ef9f7bff06842be2c25ac9adefe405bec76f (patch)
treee0dfbda557d163a9e8230c173005281910a6f2dd /pjsip
parent3bd0755aa48223b5438da8f46cfd7c18a9b7bb9e (diff)
Misc (re #1252): prevent assertion caused by bad account when scanning accounts for presence timer update. Thanks Matt DiMeo for the patch
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3604 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_pres.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_pres.c b/pjsip/src/pjsua-lib/pjsua_pres.c
index 2428a2f5..6b5b20ba 100644
--- a/pjsip/src/pjsua-lib/pjsua_pres.c
+++ b/pjsip/src/pjsua-lib/pjsua_pres.c
@@ -2175,6 +2175,10 @@ static void pres_timer_cb(pj_timer_heap_t *th,
for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) {
pjsua_acc *acc = &pjsua_var.acc[i];
+ /* Acc may not be ready yet, otherwise assertion will happen */
+ if (!pjsua_acc_is_valid(i))
+ continue;
+
/* Retry PUBLISH */
if (acc->cfg.publish_enabled && acc->publish_sess==NULL)
pjsua_pres_init_publish_acc(acc->index);