[asterisk-commits] rmudgett: trunk r264711 - /trunk/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 20 15:49:42 CDT 2010


Author: rmudgett
Date: Thu May 20 15:49:40 2010
New Revision: 264711

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=264711
Log:
Avoid crash in generic CC agent init if caller name or number is NULL.

Modified:
    trunk/main/ccss.c

Modified: trunk/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/ccss.c?view=diff&rev=264711&r1=264710&r2=264711
==============================================================================
--- trunk/main/ccss.c (original)
+++ trunk/main/ccss.c Thu May 20 15:49:40 2010
@@ -2339,8 +2339,12 @@
 	}
 
 	generic_pvt->offer_timer_id = -1;
-	ast_copy_string(generic_pvt->cid_num, chan->cid.cid_num, sizeof(generic_pvt->cid_num));
-	ast_copy_string(generic_pvt->cid_name, chan->cid.cid_name, sizeof(generic_pvt->cid_name));
+	if (chan->cid.cid_num) {
+		ast_copy_string(generic_pvt->cid_num, chan->cid.cid_num, sizeof(generic_pvt->cid_num));
+	}
+	if (chan->cid.cid_name) {
+		ast_copy_string(generic_pvt->cid_name, chan->cid.cid_name, sizeof(generic_pvt->cid_name));
+	}
 	ast_copy_string(generic_pvt->exten, S_OR(chan->macroexten, chan->exten), sizeof(generic_pvt->exten));
 	ast_copy_string(generic_pvt->context, S_OR(chan->macrocontext, chan->context), sizeof(generic_pvt->context));
 	agent->private_data = generic_pvt;




More information about the asterisk-commits mailing list