[pim/kleopatra] src/crypto/gui: Fix use-after-free on repeated decryption in the notepad

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 0c1ef70538e44d68b3afb6b1a6134626950eb0d7 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 27/07/2026 at 13:55.
Pushed by kloecker into branch 'master'.

Fix use-after-free on repeated decryption in the notepad

Suggested-by: Vadim
BUG: 523471
FIXED-IN: 26.08.0

M  +1    -0    src/crypto/gui/signencryptwidget.cpp

https://invent.kde.org/pim/kleopatra/-/commit/0c1ef70538e44d68b3afb6b1a6134626950eb0d7

diff --git a/src/crypto/gui/signencryptwidget.cpp b/src/crypto/gui/signencryptwidget.cpp
index 444af1b4b..eb6e62ee1 100644
--- a/src/crypto/gui/signencryptwidget.cpp
+++ b/src/crypto/gui/signencryptwidget.cpp
@@ -600,6 +600,7 @@ void SignEncryptWidget::clearAddedRecipients()
         d->mRecpLayout->removeWidget(w);
         delete w;
     }
+    d->mUnknownWidgets.clear();
 
     for (auto &key : std::as_const(d->mAddedKeys)) {
         removeRecipient(key);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.