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_)); + } } }