JosiahWI commented on code in PR #11450:
URL: https://github.com/apache/trafficserver/pull/11450#discussion_r1641425972


##########
src/records/RecHttp.cc:
##########
@@ -150,7 +151,7 @@ RecHttpLoadIpAddrsFromConfVar(const char *value_name, 
swoc::IPRangeSet &addrs)
 
   if (REC_ERR_OKAY == RecGetRecordString(value_name, value, sizeof(value))) {
     Debug("config", "RecHttpLoadIpAddrsFromConfVar: parsing the name [%s] and 
value [%s]", value_name, value);
-    swoc::TextView text(value);
+    swoc::TextView text(value, std::strlen(value));

Review Comment:
   Can we use this even though it's part of the C standard and not part of the 
C++ standard? https://en.cppreference.com/w/cpp/string/byte/strlen
   
   The rest of records uses `strlen(str)` after calling `RecGetRecordString` 
and this is safe because it's guaranteed to always null-terminate the buffer.



-- 
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: github-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to