xwayland: Reserve enough space for sun_path

We also need to reserve space for the final null terminator.
This commit is contained in:
Vlad Zahorodnii 2021-02-11 22:12:57 +02:00
parent df498d9be4
commit 118b817134

View file

@ -41,7 +41,7 @@ UnixSocketAddress::UnixSocketAddress(const QString &socketPath, Type type)
{
const QByteArray encodedSocketPath = QFile::encodeName(socketPath);
int byteCount = offsetof(sockaddr_un, sun_path) + encodedSocketPath.size();
int byteCount = offsetof(sockaddr_un, sun_path) + encodedSocketPath.size() + 1;
if (type == Type::Abstract) {
byteCount++; // For the first '\0'.
}