[Asterisk-cvs] asterisk/apps app_voicemail.c,1.209,1.210

markster at lists.digium.com markster at lists.digium.com
Sun May 8 12:38:02 CDT 2005


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

Modified Files:
	app_voicemail.c 
Log Message:
Fix gethostname calls (bug #4198, with mods)


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.209
retrieving revision 1.210
diff -u -d -r1.209 -r1.210
--- app_voicemail.c	29 Apr 2005 17:00:33 -0000	1.209
+++ app_voicemail.c	8 May 2005 16:44:25 -0000	1.210
@@ -1463,7 +1463,7 @@
 	FILE *p=NULL;
 	int pfd;
 	char date[256];
-	char host[256];
+	char host[MAXHOSTNAMELEN] = "";
 	char who[256];
 	char bound[256];
 	char fname[256];
@@ -1491,7 +1491,7 @@
 		}
 	}
 	if (p) {
-		gethostname(host, sizeof(host));
+		gethostname(host, sizeof(host)-1);
 		if (strchr(srcemail, '@'))
 			strncpy(who, srcemail, sizeof(who)-1);
 		else {
@@ -1618,7 +1618,7 @@
 	FILE *p=NULL;
 	int pfd;
 	char date[256];
-	char host[256];
+	char host[MAXHOSTNAMELEN]="";
 	char who[256];
 	char dur[256];
 	char tmp[80] = "/tmp/astmail-XXXXXX";
@@ -1637,7 +1637,7 @@
 	}
 
 	if (p) {
-		gethostname(host, sizeof(host));
+		gethostname(host, sizeof(host)-1);
 		if (strchr(srcemail, '@'))
 			strncpy(who, srcemail, sizeof(who)-1);
 		else {




More information about the svn-commits mailing list