Lines 2200-2208
Link Here
|
2200 |
sin.sin_family = host->h_addrtype; |
2200 |
sin.sin_family = host->h_addrtype; |
2201 |
#if defined(h_addr) /* In 4.3, this is a #define */ |
2201 |
#if defined(h_addr) /* In 4.3, this is a #define */ |
2202 |
memmove((caddr_t)&sin.sin_addr, |
2202 |
memmove((caddr_t)&sin.sin_addr, |
2203 |
host->h_addr_list[0], host->h_length); |
2203 |
host->h_addr_list[0], MIN(host->h_length, sizeof sin.sin_addr)); |
2204 |
#else /* defined(h_addr) */ |
2204 |
#else /* defined(h_addr) */ |
2205 |
memmove((caddr_t)&sin.sin_addr, host->h_addr, host->h_length); |
2205 |
memmove((caddr_t)&sin.sin_addr, host->h_addr, MIN(host->h_length, sizeof sin.sin_addr)); |
2206 |
#endif /* defined(h_addr) */ |
2206 |
#endif /* defined(h_addr) */ |
2207 |
strncpy(_hostname, host->h_name, sizeof(_hostname)); |
2207 |
strncpy(_hostname, host->h_name, sizeof(_hostname)); |
2208 |
_hostname[sizeof(_hostname)-1] = '\0'; |
2208 |
_hostname[sizeof(_hostname)-1] = '\0'; |
Lines 2294-2300
Link Here
|
2294 |
perror((char *)0); |
2294 |
perror((char *)0); |
2295 |
host->h_addr_list++; |
2295 |
host->h_addr_list++; |
2296 |
memcpy((caddr_t)&sin.sin_addr, |
2296 |
memcpy((caddr_t)&sin.sin_addr, |
2297 |
host->h_addr_list[0], host->h_length); |
2297 |
host->h_addr_list[0], MIN(host->h_length, sizeof sin.sin_addr)); |
2298 |
(void) NetClose(net); |
2298 |
(void) NetClose(net); |
2299 |
continue; |
2299 |
continue; |
2300 |
} |
2300 |
} |
Lines 2779-2787
Link Here
|
2779 |
} else if (host = gethostbyname(cp)) { |
2779 |
} else if (host = gethostbyname(cp)) { |
2780 |
#if defined(h_addr) |
2780 |
#if defined(h_addr) |
2781 |
memcpy((caddr_t)&sin_addr, |
2781 |
memcpy((caddr_t)&sin_addr, |
2782 |
host->h_addr_list[0], host->h_length); |
2782 |
host->h_addr_list[0], MIN(host->h_length, sizeof sin_addr)); |
2783 |
#else |
2783 |
#else |
2784 |
memcpy((caddr_t)&sin_addr, host->h_addr, host->h_length); |
2784 |
memcpy((caddr_t)&sin_addr, host->h_addr, MIN(host->h_length, sizeof sin_addr)); |
2785 |
#endif |
2785 |
#endif |
2786 |
} else { |
2786 |
} else { |
2787 |
*cpp = cp; |
2787 |
*cpp = cp; |