diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-08 16:44:25 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-08 16:44:25 +0000 |
commit | 64ef317fa800d98746ef903c8497e4bcb983b44e (patch) | |
tree | 43cbdcb172a60d2c629ea2fd39d2314ccdc1db2e /pbx/pbx_dundi.c | |
parent | 5ca62a6c1367dbb9fc7da9acf5cf509684ee98bc (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 'pbx/pbx_dundi.c')
-rwxr-xr-x | pbx/pbx_dundi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index ca3c4441a..323449da0 100755 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -4453,7 +4453,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin) 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 @@ static int set_config(char *config_file, struct sockaddr_in* sin) 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)); |