Copilot commented on code in PR #13356:
URL: https://github.com/apache/trafficserver/pull/13356#discussion_r3509778951


##########
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:
   UnAddr's copy constructor still uses `strncpy(..., TS_UNIX_SIZE)` without 
forcing a terminator. Since the comment notes `strncpy` doesn't terminate on 
truncation, it would be safer to mirror the other constructors and always set 
`_path[TS_UNIX_SIZE - 1] = '\0'` to guarantee null-termination even if the 
source buffer is not terminated.



-- 
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]

Reply via email to