diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-12-01 21:54:21 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-12-01 21:54:21 +0000 |
commit | f049629b4ce8a56d189c3f8decbf9f35dd5016c2 (patch) | |
tree | 3fc22860aef194ca6c85f3292990e8c8f421b575 /main | |
parent | 574839b949a96d4914cccebd5ae50ca1ce569738 (diff) |
Merged revisions 231911 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r231911 | jpeeler | 2009-12-01 15:29:31 -0600 (Tue, 01 Dec 2009) | 12 lines
Fix crash with invalid frame data
The crash was happening as a result of a frame containing an invalid data
pointer, but was set with data length of zero. The few times the issue was
reproduced it _seemed_ that the frame was queued properly, that is the data
pointer was set to NULL. I never could reproduce the crash so as a last resort
the crash has been fixed, but a check in __ast_read has been added to give as
much information about the source of problematic frames in the future.
(closes issue #16058)
Reported by: atis
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231927 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index 48eedafe7..0a727057c 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3519,6 +3519,17 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio) ast_frame_dump(chan->name, f, "<<"); chan->fin = FRAMECOUNT_INC(chan->fin); + if (f && f->datalen == 0 && f->data.ptr) { + /* fix invalid pointer */ + f->data.ptr = NULL; +#ifdef AST_DEVMODE + ast_log(LOG_ERROR, "Found frame with src '%s' on channel '%s' with datalen zero, but non-null data pointer!\n", f->src, chan->name); + ast_frame_dump(chan->name, f, "<<"); +#else + ast_debug(3, "Found frame with src '%s' on channel '%s' with datalen zero, but non-null data pointer!\n", f->src, chan->name); +#endif + } + done: if (chan->music_state && chan->generator && chan->generator->digit && f && f->frametype == AST_FRAME_DTMF_END) chan->generator->digit(chan, f->subclass.integer); |