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.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@420950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2014-08-13 16:53:09 +00:00
parent cd28e5dda2
commit e8a5847742

View 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;
}