Merged revisions 79912 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Fri, 17 Aug 2007 21:04:33 +0000 (21:04 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 17 Aug 2007 21:04:33 +0000 (21:04 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79912 | russell | 2007-08-17 16:01:43 -0500 (Fri, 17 Aug 2007) | 4 lines

Avoid a crash in the handling of DTMF based Caller ID.  It is valid for
ast_read to return NULL in the case that the channel has been hung up.
(crash reported by anonymouz666 on IRC in #asterisk-dev)

........

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

channels/chan_zap.c

index 250099d..60d9e2e 100644 (file)
@@ -6397,6 +6397,8 @@ static void *ss_thread(void *data)
                                                return NULL;
                                        } 
                                        f = ast_read(chan);
+                                       if (!f)
+                                               break;
                                        if (f->frametype == AST_FRAME_DTMF) {
                                                dtmfbuf[i++] = f->subclass;
                                                ast_debug(1, "CID got digit '%c'\n", f->subclass);