moonchen commented on code in PR #13356:
URL: https://github.com/apache/trafficserver/pull/13356#discussion_r3509872328
##########
include/tscore/ink_inet.h:
##########
@@ -1611,8 +1611,17 @@ struct UnAddr {
UnAddr() { _path[0] = 0; }
UnAddr(self const &addr) { strncpy(_path, addr._path, TS_UNIX_SIZE); }
Review Comment:
Good catch — done in 2dbcd7c1f7. The copy constructor and `operator=` now
null-terminate `_path` as well. The underlying source of an unterminated path
is `assign(sockaddr const *)`, which can ingest a full 108-byte `sun_path` from
a kernel `sockaddr_un`, so that one terminates too — the three copy paths now
all guarantee a valid C string. Added a unit test that
constructs/copies/assigns from a deliberately unterminated `sockaddr_un`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]