You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by GitBox <gi...@apache.org> on 2020/09/09 15:27:54 UTC
[GitHub] [thrift] ulidtko edited a comment on pull request #2235: Fix abstract unix socket name
ulidtko edited a comment on pull request #2235:
URL: https://github.com/apache/thrift/pull/2235#issuecomment-689635143
> we are using `c_str()' that returns an null terminated string
`c_str()` does return a null-terminated C string... but the `memcpy` is not copying it into the `sun_path`, due to `memcpy(address.sun_path, path_.c_str(), path_.size());` — `.size()` does not include the last null.
--------------------
*edit: sorry I confused this from the other PR. code in master does
```
size_t len = path_.size() + 1;
// ...
memcpy(address.sun_path, path_.c_str(), len);
```
so it's fine.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org