]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
PJSIP: Prevent crash no-URI contacts
authorKinsey Moore <kmoore@digium.com>
Wed, 13 Aug 2014 16:56:14 +0000 (16:56 +0000)
committerKinsey Moore <kmoore@digium.com>
Wed, 13 Aug 2014 16:56:14 +0000 (16:56 +0000)
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.
........

Merged revisions 420949 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420950 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420953 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_pjsip.c

index 421da8c9d87728ef4135072e11425e09a2af616b..68193f0bb7c229ca4fe29c66eb9b8c0bd29ba10f 100644 (file)
@@ -2285,7 +2285,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;
                }