Skip to content

Commit 31acf11

Browse files
committed
Remove the sensitive data from the memory when locking
1 parent 7477219 commit 31acf11

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,8 @@ Warning: Saving will discard all the entries that could not be recovered.
930930
},
931931
LoopResult::Timeout => {
932932
warn!("Idle time of {} seconds elapsed! Locking...", s.props.idle_timeout_seconds());
933+
// Remove the sensitive data from the memory
934+
s.safe = Safe::default();
933935
let message = format!("Idle time of {} seconds elapsed! Locking...", s.props.idle_timeout_seconds());
934936
let _ = s.editor.show_message(&message, vec![UserOption::ok()], MessageSeverity::default()).await;
935937
s.user_selection = UserSelection::GoTo(Menu::TryPass(false))

0 commit comments

Comments
 (0)