Merged revisions 100793 via svnmerge from
authorChristian Richter <christian.richter@beronet.com>
Tue, 29 Jan 2008 10:50:29 +0000 (10:50 +0000)
committerChristian Richter <christian.richter@beronet.com>
Tue, 29 Jan 2008 10:50:29 +0000 (10:50 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r100793 | crichter | 2008-01-29 11:36:19 +0100 (Di, 29 Jan 2008) | 1 line

fixed potential segfault in misdn show channels CLI command
........

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

channels/chan_misdn.c

index 550414b..252b004 100644 (file)
@@ -1251,10 +1251,19 @@ static char *handle_cli_misdn_show_channels(struct ast_cli_entry *e, int cmd, st
        help = cl_te;
   
        ast_cli(a->fd, "Channel 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(a->fd, "chan_list obj. with l3id:%x has no bc and no ast Leg\n", help->l3id);
+                               continue;
+                       }
+                       ast_cli(a->fd, "bc with pid:%d has no Ast Leg\n", bc->pid);
+                       continue;
+               }
+
                if (misdn_debug[0] > 2)
                        ast_cli(a->fd, "Bc:%p Ast:%p\n", bc, ast);
                if (bc) {