From 60ee73bf1df870341ac9a729e5df7b682cff7cc2 Mon Sep 17 00:00:00 2001 From: DanS Date: Tue, 14 Jul 2026 11:17:34 -0500 Subject: [PATCH] fix(settings): wipe change-passphrase buffers on dialog dismiss The Change Passphrase dialog only zeroed change_old/new/confirm_pass_buf_ on the success path (inside changePassphrase); dismissing via X / Esc / outside- click left the typed passphrases resident in the input buffers. Add a same- frame teardown mirroring the encrypt dialog's X-button cleanup: when the BlurFloat overlay clears show_change_passphrase_ mid-frame, memset the three buffers. The failure path still keeps them intact for retry, and the async change already copies the passphrases into worker-owned strings, so wiping the UI buffers cannot disturb an in-flight change. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app_security.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app_security.cpp b/src/app_security.cpp index 60268b6..8ff032f 100644 --- a/src/app_security.cpp +++ b/src/app_security.cpp @@ -1401,6 +1401,15 @@ void App::renderEncryptWalletDialog() { ImGui::EndDisabled(); EndOverlayDialog(); } + + // Wipe the passphrase buffers if the dialog was dismissed (X / Esc / + // outside-click) without submitting. The success path already zeroes + // them in changePassphrase(); the failure path keeps them for retry. + if (!show_change_passphrase_) { + memset(change_old_pass_buf_, 0, sizeof(change_old_pass_buf_)); + memset(change_new_pass_buf_, 0, sizeof(change_new_pass_buf_)); + memset(change_confirm_buf_, 0, sizeof(change_confirm_buf_)); + } } }