aboutsummaryrefslogtreecommitdiffstats
path: root/acl.c
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 /acl.c
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 'acl.c')
-rwxr-xr-xacl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/acl.c b/acl.c
index 1459da254..bb735dfbf 100755
--- a/acl.c
+++ b/acl.c
@@ -405,7 +405,7 @@ struct ast_netsock *ast_netsock_bind(struct ast_netsock_list *list, struct io_co
int ast_find_ourip(struct in_addr *ourip, struct sockaddr_in bindaddr)
{
- char ourhost[256];
+ char ourhost[MAXHOSTNAMELEN]="";
struct ast_hostent ahp;
struct hostent *hp;
struct in_addr saddr;
@@ -416,7 +416,7 @@ int ast_find_ourip(struct in_addr *ourip, struct sockaddr_in bindaddr)
return 0;
}
/* try to use our hostname */
- if (gethostname(ourhost, sizeof(ourhost))) {
+ if (gethostname(ourhost, sizeof(ourhost)-1)) {
ast_log(LOG_WARNING, "Unable to get hostname\n");
} else {
hp = ast_gethostbyname(ourhost, &ahp);