[asterisk-commits] mmichelson: trunk r200290 - /trunk/apps/app_queue.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 12 09:55:11 CDT 2009
Author: mmichelson
Date: Fri Jun 12 09:55:07 2009
New Revision: 200290
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=200290
Log:
Fix a potential crash from trying to access a NULL channel pointer.
Modified:
trunk/apps/app_queue.c
Modified: trunk/apps/app_queue.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_queue.c?view=diff&rev=200290&r1=200289&r2=200290
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Fri Jun 12 09:55:07 2009
@@ -3086,9 +3086,11 @@
* 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);
More information about the asterisk-commits
mailing list