From 3c70205ac0986988a6da33643e006f5342e83a2e Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 24 Dec 2019 05:53:06 +0000 Subject: [PATCH] take prefix into account and use HEX string in QSharedMemoryPrivate::makePlatformSafeKey() Signed-off-by: Ivailo Monev --- src/core/kernel/qsharedmemory.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/core/kernel/qsharedmemory.cpp b/src/core/kernel/qsharedmemory.cpp index 2b32024dc..90d95ad83 100644 --- a/src/core/kernel/qsharedmemory.cpp +++ b/src/core/kernel/qsharedmemory.cpp @@ -35,7 +35,6 @@ #include "qsharedmemory_p.h" #include "qsystemsemaphore.h" #include "qdir.h" -#include "qcryptographichash.h" #include "qdebug.h" QT_BEGIN_NAMESPACE @@ -55,11 +54,7 @@ QString QSharedMemoryPrivate::makePlatformSafeKey(const QString &key, if (key.isEmpty()) return QString(); - QString part1 = key; - part1.replace(QRegExp(QLatin1String("[^A-Za-z]")), QString()); - - QByteArray hex = QCryptographicHash::hash(key.toUtf8(), QCryptographicHash::Sha1).toHex(); - QString result = (part1 + QString::fromLatin1(hex.constData())); + QString result = prefix + key.toUtf8().toHex(); #if defined(QT_POSIX_IPC) return QLatin1Char('/') + result; #else