diff options
author | Wez Furlong <wez@wezfurlong.org> | 2019-08-01 12:45:31 -0700 |
---|---|---|
committer | Wez Furlong <wez@wezfurlong.org> | 2019-08-01 12:45:31 -0700 |
commit | c49581f85ad9c3ad0e5b7595f5c7d6e72ea9a61b (patch) | |
tree | 1143f49ddaef05542829266a5e61eb80c445e428 /src/session.rs | |
parent | 672893d6f8ff3fec22f7f509247adeb477aa5f4a (diff) | |
download | ssh2-rs-c49581f85ad9c3ad0e5b7595f5c7d6e72ea9a61b.zip |
ignore the panic result from the keyboard prompt
There's not a lot we can do about it.
Diffstat (limited to 'src/session.rs')
-rw-r--r-- | src/session.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/session.rs b/src/session.rs index cd33327..a8e5dc3 100644 --- a/src/session.rs +++ b/src/session.rs @@ -311,7 +311,10 @@ impl Session { abstrakt: *mut *mut c_void, ) { use std::panic::{catch_unwind, AssertUnwindSafe}; - catch_unwind(AssertUnwindSafe(|| { + // Catch panics; we can't let them unwind to C code. + // There's not much to be done with them though because the + // signature of the callback doesn't allow reporting an error. + let _ = catch_unwind(AssertUnwindSafe(|| { let prompter = unsafe { &mut **(abstrakt as *mut *mut P) }; let username = |