From: Kinsey Moore Date: Wed, 13 Aug 2014 16:47:10 +0000 (+0000) Subject: PJSIP: Prevent crash no-URI contacts X-Git-Tag: 12.6.0-rc1~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5be2f621ab6591fff0992cd26f79cb39434a2dcb;p=thirdparty%2Fasterisk.git PJSIP: Prevent crash no-URI contacts This prevents a crash from occurring when a contact with no URI is used for the creation of an outbound out-of-dialog request with no associated endpoint. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@420949 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 758c0e3c3e..68fed09dec 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -1740,7 +1740,7 @@ static int create_out_of_dialog_request(const pjsip_method *method, struct ast_s pjsip_tpselector selector = { .type = PJSIP_TPSELECTOR_NONE, }; if (ast_strlen_zero(uri)) { - if (!endpoint && !contact) { + if (!endpoint && (!contact || ast_strlen_zero(contact->uri))) { ast_log(LOG_ERROR, "An endpoint and/or uri must be specified\n"); return -1; }