]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fixed potential segfault in misdn show channels CLI command
authorChristian Richter <christian.richter@beronet.com>
Tue, 29 Jan 2008 10:36:19 +0000 (10:36 +0000)
committerChristian Richter <christian.richter@beronet.com>
Tue, 29 Jan 2008 10:36:19 +0000 (10:36 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100793 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_misdn.c

index ccdef6f7a892e9e23e1ff9960962a71c654258f6..47505dfddf5322b3e08290e66664d792c67e8c31 100644 (file)
@@ -1127,10 +1127,18 @@ static int misdn_show_cls (int fd, int argc, char *argv[])
        struct chan_list *help=cl_te;
   
        ast_cli(fd,"Chan List: %p\n",cl_te); 
-  
+
        for (;help; help=help->next) {
                struct misdn_bchannel *bc=help->bc;   
                struct ast_channel *ast=help->ast;
+               if (!ast) {
+                       if (!bc) {
+                               ast_cli(fd, "chan_list obj. with l3id:%x has no bc and no ast Leg\n", help->l3id);
+                               continue;
+                       }
+                       ast_cli(fd, "bc with pid:%d has no Ast Leg\n", bc->pid);
+                       continue;
+               }
                if (misdn_debug[0] > 2) ast_cli(fd, "Bc:%p Ast:%p\n", bc, ast);
                if (bc) {
                        print_bc_info(fd, help, bc);