From 1eb76bbdb046927adeb3cbcfb77de5d14186af3a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 16 May 2026 16:08:02 -0500 Subject: [PATCH] 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. --- app/backend/identitymanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/backend/identitymanager.cpp b/app/backend/identitymanager.cpp index 3d7078c1..3f8e724f 100644 --- a/app/backend/identitymanager.cpp +++ b/app/backend/identitymanager.cpp @@ -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);