mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 20:49:11 +00:00
(svn r14414) -Fix: replace instances of strncpy with strecpy as strncpy doesn't guarantee the resulting string is '\0'-terminated.
This commit is contained in:
@@ -162,7 +162,7 @@ static int NetworkFindBroadcastIPsInternal(uint32 *broadcast, int limit) // !GET
|
||||
if (req->ifr_addr.sa_family == AF_INET) {
|
||||
struct ifreq r;
|
||||
|
||||
strncpy(r.ifr_name, req->ifr_name, lengthof(r.ifr_name));
|
||||
strecpy(r.ifr_name, req->ifr_name, lastof(r.ifr_name));
|
||||
if (ioctl(sock, SIOCGIFFLAGS, &r) != -1 &&
|
||||
r.ifr_flags & IFF_BROADCAST &&
|
||||
ioctl(sock, SIOCGIFBRDADDR, &r) != -1) {
|
||||
|
Reference in New Issue
Block a user