aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-08 16:44:25 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-08 16:44:25 +0000
commit64ef317fa800d98746ef903c8497e4bcb983b44e (patch)
tree43cbdcb172a60d2c629ea2fd39d2314ccdc1db2e /apps
parent5ca62a6c1367dbb9fc7da9acf5cf509684ee98bc (diff)
Fix gethostname calls (bug #4198, with mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5600 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_voicemail.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index b3fb4f9cc..c087e7de3 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1463,7 +1463,7 @@ static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *c
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 @@ static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *c
}
}
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 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
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 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
}
if (p) {
- gethostname(host, sizeof(host));
+ gethostname(host, sizeof(host)-1);
if (strchr(srcemail, '@'))
strncpy(who, srcemail, sizeof(who)-1);
else {