(realm_of_cell): don't overwrite buffer with result from `gethostbyaddr'

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1622 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-04-23 21:30:01 +00:00
parent 300821313c
commit 4e3af3c29e

View File

@@ -150,7 +150,8 @@ realm_of_cell(char *cell)
hp = gethostbyaddr((char*)&addr, 4, AF_INET);
if(hp == NULL)
break;
strcpy(buf, hp->h_name);
strncpy (buf, hp->h_name, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
realm = krb_realmofhost(buf);
break;
}