You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another note, this function will only return the first address assignment found for this node on the given network. For the vast majority of cases this is desired but I plan to introduce an extended version of this function that will return an array of addresses. Probably when somebody asks for it.
My C is super rusty, but this doesn't seem right -
This makes a scratch buffer of length
INET_ADDRSTRLEN
to pass toInetAddress::toString
:libzt/src/ZT1Service.cpp
Line 273 in 4f6908b
INET_ADDRSTRLEN
is 16, since an IPv4 address can be at most 15 characters.But
toString
also adds the "port" - which I think is the CIDR mask of the ZT network - onto the end of the string, which means it can be 3 bytes longer, e.g. "/24":https://github.com/zerotier/ZeroTierOne/blob/ee4783e3fb975d73aabeaa433c346aea043908a9/node/InetAddress.cpp#L132
Unless I'm missing something, that'd be writing 18 bytes into a 16 byte buffer :(
The text was updated successfully, but these errors were encountered: