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
1 changed files with 2 additions and 1 deletions

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;