]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_pjsip: Fix crash during off-nominal when no endpoint specified. 76/476/8
authorsnuffy <snuffy22@gmail.com>
Fri, 15 May 2015 03:05:52 +0000 (13:05 +1000)
committerJoshua Colp <jcolp@digium.com>
Sun, 17 May 2015 12:44:00 +0000 (07:44 -0500)
Add missing return -1 when no endpoint name is specified.

ASTERISK-25086 #close
Reported by: snuffy

Change-Id: I9de76c2935a1f4e3f0cffe97a670106f5605e89e

channels/chan_pjsip.c

index c111cf1d3f581995db788d3c383460276d8b2706..b7d7065f275fa33e39d6ad5d2a016b2e65df110e 100644 (file)
@@ -1815,6 +1815,7 @@ static int request(void *obj)
        if (ast_strlen_zero(endpoint_name)) {
                ast_log(LOG_ERROR, "Unable to create PJSIP channel with empty endpoint name\n");
                req_data->cause = AST_CAUSE_CHANNEL_UNACCEPTABLE;
+               return -1;
        } else if (!(endpoint = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint", endpoint_name))) {
                ast_log(LOG_ERROR, "Unable to create PJSIP channel - endpoint '%s' was not found\n", endpoint_name);
                req_data->cause = AST_CAUSE_NO_ROUTE_DESTINATION;