mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 03:48:02 +00:00
Fix gethostname calls (bug #4198, with mods)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user