diff --git a/server/main.cpp b/server/main.cpp index af2f457d..8c4a7bfa 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -100,6 +100,8 @@ int create_listen_socket() sockaddr_un addr{}; auto sock_file = socket_path(); + if (sock_file.native().size() >= std::size(addr.sun_path)) + throw std::runtime_error("Socket file name too long"); addr.sun_family = AF_UNIX; strcpy(addr.sun_path, sock_file.c_str());