diff --git a/include/libtorrent/enum_net.hpp b/include/libtorrent/enum_net.hpp index 2616f4bed..643c4c0c0 100644 --- a/include/libtorrent/enum_net.hpp +++ b/include/libtorrent/enum_net.hpp @@ -43,7 +43,7 @@ namespace libtorrent { address interface_address; address netmask; - char name[32]; + char name[64]; }; struct ip_route @@ -51,7 +51,7 @@ namespace libtorrent address destination; address netmask; address gateway; - char name[32]; + char name[64]; }; // returns a list of the configured IP interfaces diff --git a/src/enum_net.cpp b/src/enum_net.cpp index bb941411e..4b9a7b1ce 100644 --- a/src/enum_net.cpp +++ b/src/enum_net.cpp @@ -558,7 +558,7 @@ namespace libtorrent r.source = address::from_string(adapter->IpAddressList.IpAddress.String, ec); r.gateway = address::from_string(adapter->GatewayList.IpAddress.String, ec); r.netmask = address::from_string(adapter->IpAddressList.IpMask.String, ec); - strcpy(r.name, adapter->AdapterName); + strncpy(r.name, adapter->AdapterName, sizeof(ip_route::name)); if (ec) {