diff --git a/src/xwl/xwaylandsocket.cpp b/src/xwl/xwaylandsocket.cpp index c588b67e3f..96c64d7c59 100644 --- a/src/xwl/xwaylandsocket.cpp +++ b/src/xwl/xwaylandsocket.cpp @@ -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'. }