[Asterisk-cvs] asterisk/channels chan_sip.c,1.590,1.591

markster at lists.digium.com markster at lists.digium.com
Mon Dec 13 10:29:32 CST 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv16159/channels

Modified Files:
	chan_sip.c 
Log Message:
Fix res_config_mysql crash (thanks drumkilla!) (bug #3009)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.590
retrieving revision 1.591
diff -u -d -r1.590 -r1.591
--- chan_sip.c	12 Dec 2004 04:25:59 -0000	1.590
+++ chan_sip.c	13 Dec 2004 15:26:26 -0000	1.591
@@ -8500,7 +8500,8 @@
 	if (peer) {
 		peer->lastmsgssent = -1;
 		if (!found) {
-			strncpy(peer->name, name, sizeof(peer->name)-1);
+			if (name)
+				strncpy(peer->name, name, sizeof(peer->name)-1);
 			strncpy(peer->context, default_context, sizeof(peer->context)-1);
 			strncpy(peer->language, default_language, sizeof(peer->language)-1);
 			strncpy(peer->musicclass, global_musicclass, sizeof(peer->musicclass)-1);
@@ -8527,7 +8528,9 @@
 		peer->ospauth = global_ospauth;
 #endif
 		while(v) {
-			if (!strcasecmp(v->name, "secret")) 
+			if (!strcasecmp(v->name, "name"))
+				strncpy(peer->name, v->value, sizeof(peer->name)-1);
+			else if (!strcasecmp(v->name, "secret")) 
 				strncpy(peer->secret, v->value, sizeof(peer->secret)-1);
 			else if (!strcasecmp(v->name, "md5secret")) 
 				strncpy(peer->md5secret, v->value, sizeof(peer->md5secret)-1);




More information about the svn-commits mailing list