mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-14 09:38:07 -05:00

Thanks to Jacob for spotting this one: when we hand a passphrase back to pageant.c via pageant_passphrase_request_success(), if the key doesn't decrypt successfully, pageant.c responds by immediately issuing another passphrase prompt - and it does it _synchronously_, by calling back from within pageant_passphrase_request_success(). In this case, the effect is that we end up in ask_passphrase_common(), which starts by asserting that nonmodal_passphrase_hwnd is NULL - but it wasn't NULL _quite_ yet, because end_passphrase_dialog() was expecting to clean it up immediately after pageant_passphrase_request_success() returned, i.e. just too late. The heavyweight fix would be to arrange a toplevel callback to defer opening the new window until after the old one had been cleaned up. But in this case I don't think there's any need: it's enough to simply do the operations in end_passphrase_dialog() in the opposite order, so that first we destroy the old window and set nonmodal_passphrase_hwnd back to NULL, and _then_ we call into pageant.c which might call us back and open a fresh window.