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


##########
src/records/RecHttp.cc:
##########
@@ -368,10 +368,16 @@ HttpProxyPort::processOptions(const char *opts)
 
   for (auto item : values) {
     if (item[0] == '/') {
-      m_family    = AF_UNIX;
-      m_unix_path = UnAddr(item);
-      af_set_p    = true;
-      zret        = true;
+      if (size_t len = strlen(item); len >= TS_UNIX_SIZE) {
+        // A longer path would be silently truncated and the listener bound to 
the wrong
+        // filesystem path.
+        Warning("Unix path '%s' in port configuration '%s' is too long (%zu 
bytes, max %zu)", item, opts, len, TS_UNIX_SIZE - 1);
+      } else {
+        m_family    = AF_UNIX;
+        m_unix_path = UnAddr(item);
+        af_set_p    = true;
+        zret        = true;
+      }

Review Comment:
   Done — the whole descriptor is now rejected once the over-long path is 
detected, so a trailing token can't turn it into an INET listener. Added a 
regression test.



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