2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Match socket length check with Qt

This commit is contained in:
Ilya Fedin
2022-03-08 12:23:59 +04:00
committed by John Preston
parent cbe7b5f61b
commit 6fd02ccbae

View File

@@ -50,6 +50,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <cstdlib>
#include <unistd.h>
#include <dirent.h>
@@ -384,7 +385,7 @@ QString SingleInstanceLocalServerName(const QString &hash) {
+ '-'
+ cGUIDStr();
if (idealSocketPath.size() >= 108) {
if ((idealSocketPath.size() + 1) >= sizeof(sockaddr_un().sun_path)) {
return AppRuntimeDirectory() + hash;
} else {
return idealSocketPath;