[Asterisk-cvs] asterisk/channels chan_h323.c,1.98,1.99

jeremy at lists.digium.com jeremy at lists.digium.com
Sun Dec 19 19:18:17 CST 2004


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

Modified Files:
	chan_h323.c 
Log Message:
Create string properly and cast peer correctly

Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- chan_h323.c	18 Dec 2004 07:10:46 -0000	1.98
+++ chan_h323.c	20 Dec 2004 00:14:19 -0000	1.99
@@ -484,7 +484,7 @@
         int res = 0;
         struct oh323_pvt *pvt = (struct oh323_pvt *)c->pvt->pvt;
         char addr[INET_ADDRSTRLEN];
-        char called_addr[INET_ADDRSTRLEN];
+        char called_addr[1024];
   
         if ((c->_state != AST_STATE_DOWN) && (c->_state != AST_STATE_RESERVED)) {
                 ast_log(LOG_WARNING, "Line is already in use (%s)\n", c->name);
@@ -511,9 +511,9 @@
 	pvt->outgoing = 1;
 
 	if (pvt->exten) {
-		sprintf(called_addr, "%s@%s:%d", pvt->exten, addr, pvt->options.port);
+		snprintf(called_addr, sizeof(called_addr), "%s@%s:%d", pvt->exten, addr, pvt->options.port);
 	} else {
-		sprintf(called_addr, "%s:%d",addr, pvt->options.port);
+		snprintf(called_addr, sizeof(called_addr), "%s:%d",addr, pvt->options.port);
 	}
 	ast_log(LOG_DEBUG, "Placing outgoing call to %s, %d\n", called_addr, pvt->options.dtmfcodec);
 	res = h323_make_call(called_addr, &(pvt->cd), &pvt->options);
@@ -925,7 +925,7 @@
 	return u;
 }
 
-struct oh323_peer *find_peer(char *peer, struct sockaddr_in *sin)
+struct oh323_peer *find_peer(const char *peer, struct sockaddr_in *sin)
 {
 	struct oh323_peer *p = NULL;
        	static char iabuf[INET_ADDRSTRLEN];




More information about the svn-commits mailing list