2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix possible race conditions in msgid().

This commit is contained in:
John Preston
2019-07-10 19:28:33 +02:00
parent 68b1024dd4
commit c5df4db621
63 changed files with 513 additions and 391 deletions

View File

@@ -118,8 +118,10 @@ void ComputeInstallationTag() {
file.close();
}
if (!InstallationTag) {
auto generator = std::mt19937(std::random_device()());
auto distribution = std::uniform_int_distribution<uint64>();
do {
memsetrnd_bad(InstallationTag);
InstallationTag = distribution(generator);
} while (!InstallationTag);
if (file.open(QIODevice::WriteOnly)) {