summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2009-06-12 14:55:07 +0000
committerMark Michelson <mmichelson@digium.com>2009-06-12 14:55:07 +0000
commitd222361a29a78a23f7e465c4a4271318fd61386d (patch)
treea3084a98a21485cd411e89752c5a5f5f0e9cb397
parent4e9cce1b72da106b40636ba9b98de258af3d3272 (diff)
Fix a potential crash from trying to access a NULL channel pointer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--apps/app_queue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 65b297052..8fe2cdc98 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3086,9 +3086,11 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
* ast_strdupa in a loop like this one can cause a stack overflow
*/
char ochan_name[AST_CHANNEL_NAME];
- ast_channel_lock(o->chan);
- ast_copy_string(ochan_name, o->chan->name, sizeof(ochan_name));
- ast_channel_unlock(o->chan);
+ if (o->chan) {
+ ast_channel_lock(o->chan);
+ ast_copy_string(ochan_name, o->chan->name, sizeof(ochan_name));
+ ast_channel_unlock(o->chan);
+ }
if (o->stillgoing && (o->chan) && (o->chan->_state == AST_STATE_UP)) {
if (!peer) {
ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);