summaryrefslogtreecommitdiff
path: root/pbx/pbx_dundi.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2005-05-08 16:44:25 +0000
committerMark Spencer <markster@digium.com>2005-05-08 16:44:25 +0000
commit00bcbaaa050472058d1a26295fb3741f2b467e38 (patch)
tree43cbdcb172a60d2c629ea2fd39d2314ccdc1db2e /pbx/pbx_dundi.c
parentfa0f44a347a541ee1e996895c6b00df83b819e59 (diff)
Fix gethostname calls (bug #4198, with mods)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx/pbx_dundi.c')
-rwxr-xr-xpbx/pbx_dundi.c4
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));