]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Pass through a frame if we don't know what it is, rather than trying to pass a
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 24 Oct 2006 03:01:00 +0000 (03:01 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 24 Oct 2006 03:01:00 +0000 (03:01 +0000)
NULL, which will segfault a channel driver (Bug 8149)

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

main/channel.c

index fb0d7464c000163261bf780ab7684d315ab8c075..4c6b630e46e130bbd6db6f400ccac7ea9fd4a40a 100644 (file)
@@ -2611,7 +2611,10 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
                res = 0;
                break;
        default:
-               res = chan->tech->write(chan, f);
+               /* At this point, fr is the incoming frame and f is NULL.  Channels do
+                * not expect to get NULL as a frame pointer and will segfault.  Hence,
+                * we output the original frame passed in. */
+               res = chan->tech->write(chan, fr);
                break;
        }