Partially fixes #168 by using a sockaddr_storage structure instead of sockaddr in connect_to_remote() , if available. It will prevent an out-of-bounds read when calling inet_ntop.
The bug will still be present when compiling without sockaddr_storage support, but there is not a lot we can do to prevent it without having to declare this structure ourselves and use it across the whole project.
I'm not working often in C, so comments / remarks are highly welcome :-)
Partially fixes #168 by using a
sockaddr_storage
structure instead ofsockaddr
inconnect_to_remote()
, if available. It will prevent an out-of-bounds read when callinginet_ntop
.The bug will still be present when compiling without
sockaddr_storage
support, but there is not a lot we can do to prevent it without having to declare this structure ourselves and use it across the whole project.I'm not working often in C, so comments / remarks are highly welcome :-)