SolidWallOfCode commented on a change in pull request #8276:
URL: https://github.com/apache/trafficserver/pull/8276#discussion_r698588977
##########
File path: iocore/utils/Machine.cc
##########
@@ -65,7 +65,8 @@ Machine::Machine(char const *the_hostname, sockaddr const
*addr)
// limit is 63, or 255 for a FQDN.
auto result = gethostname(localhost, sizeof(localhost));
ink_release_assert(result == 0);
- host_name.assign(localhost, strlen(localhost));
+ host_name.assign(localhost, result);
Review comment:
No! That must be `strlen(localhost)`.
--
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]