X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Futil%2Fhostparse.c;h=51c4bfb7ce2ca133196d1b576712b3b7cc9501ef;hp=4644a97fd957f9980be58521e325533436dfbe59;hb=fcb7974b838c2b37a8b81b88b11905c6ece398f6;hpb=cc194827a841f057654f1dbe4dcb3f6de98c1c60 diff --git a/src/util/hostparse.c b/src/util/hostparse.c index 4644a97..51c4bfb 100644 --- a/src/util/hostparse.c +++ b/src/util/hostparse.c @@ -104,8 +104,8 @@ hostutil_GetNameByINet(afs_uint32 addr) return NULL; #endif th = gethostbyaddr((void *)&addr, sizeof(addr), AF_INET); - if (th) { - strcpy(tbuffer, th->h_name); + if (th && strlen(th->h_name) < sizeof(tbuffer)) { + strlcpy(tbuffer, th->h_name, sizeof(tbuffer)); } else { addr = ntohl(addr); sprintf(tbuffer, "%d.%d.%d.%d", (int)((addr >> 24) & 0xff),