Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There is an OpenBSD bug where the "len" returned by functions like "getsockname" is too long and makes it so the resulting address contains zero bytes. While this isn't a problem for C code, where strings are null terminated anyways, it's a problem for Rust. This commit fixes this issue by adding a check that truncates the address length to the first zero when OpenBSD is detected. If there are no zeroes, it just uses the original length provided by the system. Signed-off-by: John Nunley <[email protected]>
- Loading branch information