mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-05-19 08:00:27 +00:00
Deep copy the BIO's backing memory for the QSslKey
This doesn't appear to be a problem in practice, but the docs don't say that Qt couldn't retain this QByteArray for later, which would result in a UAF with the current code.
This commit is contained in:
@@ -170,7 +170,7 @@ IdentityManager::getSslKey()
|
||||
|
||||
BUF_MEM* mem;
|
||||
BIO_get_mem_ptr(bio, &mem);
|
||||
m_CachedSslKey = QSslKey(QByteArray::fromRawData(mem->data, (int)mem->length), QSsl::Rsa);
|
||||
m_CachedSslKey = QSslKey(QByteArray(mem->data, (int)mem->length), QSsl::Rsa);
|
||||
|
||||
BIO_free(bio);
|
||||
EVP_PKEY_free(pk);
|
||||
|
||||
Reference in New Issue
Block a user