From 82c659bf686e51ce6c62bf855dca777f0479b85b Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 11 Nov 2009 00:21:55 +0000 Subject: Misc (#951): check when app specifies max_calls that is greater than PJSUA_MAX_CALLS (thanks Robbie Hanson for the report) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3012 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_core.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pjsip') diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index 6e41cbe0..7c428d18 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -683,6 +683,12 @@ PJ_DEF(pj_status_t) pjsua_init( const pjsua_config *ua_cfg, return status; } + /* Verify settings */ + if (ua_cfg->max_calls >= PJSUA_MAX_CALLS) { + pjsua_perror(THIS_FILE, "Invalid max_calls setting", PJ_ETOOMANY); + return PJ_EINVAL; + } + /* If nameserver is configured, create DNS resolver instance and * set it to be used by SIP resolver. */ -- cgit v1.2.3