From 118b817134512ba64fdac54abd46cf2c92f69ba5 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 11 Feb 2021 22:12:57 +0200 Subject: [PATCH] xwayland: Reserve enough space for sun_path We also need to reserve space for the final null terminator. --- src/xwl/xwaylandsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'. }