PINE: Fix stack buffer overflow for long XDG_RUNTIME_DIR paths

This commit is contained in:
chaoticgd 2024-11-21 11:15:18 +00:00 committed by Ty
parent 8e8277c0c9
commit f69d5835b8
1 changed files with 1 additions and 1 deletions

View File

@ -306,7 +306,7 @@ bool PINEServer::Initialize(int slot)
return false;
}
server.sun_family = AF_UNIX;
strcpy(server.sun_path, m_socket_name.c_str());
StringUtil::Strlcpy(server.sun_path, m_socket_name, sizeof(server.sun_path));
// we unlink the socket so that when releasing this thread the socket gets
// freed even if we didn't close correctly the loop