]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Avoid a crash in the handling of DTMF based Caller ID. It is valid for
authorRussell Bryant <russell@russellbryant.com>
Fri, 17 Aug 2007 21:01:43 +0000 (21:01 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 17 Aug 2007 21:01:43 +0000 (21:01 +0000)
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/branches/1.4@79912 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index d20596dbd786b0a5bb2c59e2940ced56a2be2212..6c096708197a927a7d24637f9f088bead1390d77 100644 (file)
@@ -6111,6 +6111,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_log(LOG_DEBUG, "CID got digit '%c'\n", f->subclass);