mirror of
https://github.com/wassname/ray.git
synced 2026-08-13 12:30:18 +08:00
Check AF_UNIX path length (#7951)
This commit is contained in:
@@ -100,6 +100,9 @@ ParseUrlEndpoint(const std::string &endpoint, int default_port) {
|
||||
}
|
||||
if (scheme == "unix://") {
|
||||
#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
|
||||
size_t maxlen = sizeof(sockaddr_un().sun_path) / sizeof(*sockaddr_un().sun_path) - 1;
|
||||
RAY_CHECK(address.size() <= maxlen)
|
||||
<< "AF_UNIX path length cannot exceed " << maxlen << " bytes: " << address;
|
||||
result = boost::asio::local::stream_protocol::endpoint(address);
|
||||
#else
|
||||
RAY_LOG(FATAL) << "UNIX-domain socket endpoints are not supported: " << endpoint;
|
||||
|
||||
Reference in New Issue
Block a user