diff -urN tftp-hpa-0.36.orig/tftp/main.c tftp-hpa-0.36/tftp/main.c --- tftp-hpa-0.36.orig/tftp/main.c 2004-01-08 23:47:00 +0300 +++ tftp-hpa-0.36/tftp/main.c 2004-10-28 10:06:18 +0400 @@ -380,7 +380,9 @@ return; } peeraddr.sin_family = host->h_addrtype; - bcopy(host->h_addr, &peeraddr.sin_addr, host->h_length); + bcopy(host->h_addr, &peeraddr.sin_addr, + host->h_length > sizeof(peeraddr.sin_addr) ? + sizeof(peeraddr.sin_addr) : host->h_length); hostname = xstrdup(host->h_name); port = sp->s_port; @@ -504,7 +506,9 @@ herror((char *)NULL); return; } - bcopy(hp->h_addr, &peeraddr.sin_addr, hp->h_length); + bcopy(hp->h_addr, &peeraddr.sin_addr, + hp->h_length > sizeof(peeraddr.sin_addr) ? + sizeof(peeraddr.sin_addr) : hp->h_length); peeraddr.sin_family = hp->h_addrtype; connected = 1; hostname = xstrdup(hp->h_name); @@ -596,7 +600,8 @@ continue; } bcopy(hp->h_addr, (caddr_t)&peeraddr.sin_addr, - hp->h_length); + hp->h_length > sizeof(peeraddr.sin_addr) ? + sizeof(peeraddr.sin_addr) : hp->h_length); peeraddr.sin_family = hp->h_addrtype; connected = 1; hostname = xstrdup(hp->h_name);