[Asterisk-cvs] asterisk/pbx pbx_dundi.c,1.33,1.34
markster at lists.digium.com
markster at lists.digium.com
Sun May 8 12:38:02 CDT 2005
Update of /usr/cvsroot/asterisk/pbx
In directory mongoose.digium.com:/tmp/cvs-serv23957/pbx
Modified Files:
pbx_dundi.c
Log Message:
Fix gethostname calls (bug #4198, with mods)
Index: pbx_dundi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_dundi.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- pbx_dundi.c 29 Apr 2005 17:00:33 -0000 1.33
+++ pbx_dundi.c 8 May 2005 16:44:25 -0000 1.34
@@ -4453,7 +4453,7 @@
char *cat;
int format;
int x;
- char hn[256];
+ char hn[MAXHOSTNAMELEN]="";
struct ast_hostent he;
struct hostent *hp;
struct sockaddr_in sin2;
@@ -4470,7 +4470,7 @@
return -1;
}
ipaddr[0] = '\0';
- if (!gethostname(hn, sizeof(hn))) {
+ if (!gethostname(hn, sizeof(hn)-1)) {
hp = ast_gethostbyname(hn, &he);
if (hp) {
memcpy(&sin2.sin_addr, hp->h_addr, sizeof(sin2.sin_addr));
More information about the svn-commits
mailing list