mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Fix history-destroying use after free in Core::getSaltFromFile
We returned a shallow copy of the delete[]'d salt buffer As a result the history consistently failed to decrypt and was removed as corrupted. This is now fixed.
This commit is contained in:
parent
fff2caa0e1
commit
4fc6632d78
|
@ -160,7 +160,7 @@ QByteArray Core::getSaltFromFile(QString filename)
|
|||
return QByteArray();
|
||||
}
|
||||
|
||||
QByteArray res = QByteArray::fromRawData(reinterpret_cast<const char*>(salt), TOX_PASS_SALT_LENGTH);
|
||||
QByteArray res(reinterpret_cast<const char*>(salt), TOX_PASS_SALT_LENGTH);
|
||||
delete[] salt;
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user