]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_pjsip: Fix crash when CHANNEL dialplan function is invoked with pjsip argument...
authorJoshua Colp <jcolp@digium.com>
Sat, 14 Feb 2015 18:19:07 +0000 (18:19 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 14 Feb 2015 18:19:07 +0000 (18:19 +0000)
ASTERISK-24771 #close
Reported by: Niklas Larsson

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

channels/pjsip/dialplan_functions.c

index 6069159f92f6355b8c54136027c0f5eeaaeb43cc..fabb5c937ab4db4b37d4ed93d6b65e534f5e8554 100644 (file)
@@ -591,7 +591,10 @@ static int channel_read_pjsip(struct ast_channel *chan, const char *type, const
 
        dlg = channel->session->inv_session->dlg;
 
-       if (!strcmp(type, "secure")) {
+       if (ast_strlen_zero(type)) {
+               ast_log(LOG_WARNING, "You must supply a type field for 'pjsip' informatio\n");
+               return -1;
+       } else if (!strcmp(type, "secure")) {
 #ifdef HAVE_PJSIP_GET_DEST_INFO
                pjsip_host_info dest;
                pj_pool_t *pool = pjsip_endpt_create_pool(ast_sip_get_pjsip_endpoint(), "secure-check", 128, 128);