1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 14:39:24 -05:00

term_get_userpass_input: missing NULL check.

If term_get_userpass_input is called with term->ldisc not yet set up,
then we had a special-case handler that returns an error message - but
it does it via the same subroutine that returns normal results, which
also turns off the prompt callback in term->ldisc! Need an extra NULL
check in that subroutine. Thanks Coverity.
This commit is contained in:
Simon Tatham 2022-01-29 18:22:31 +00:00
parent d78d14f917
commit b7a9cdd6ee

View File

@ -7677,7 +7677,8 @@ static inline SeatPromptResult signal_prompts_t(Terminal *term, prompts_t *p,
{ {
assert(p->callback && "Asynchronous userpass input requires a callback"); assert(p->callback && "Asynchronous userpass input requires a callback");
queue_toplevel_callback(p->callback, p->callback_ctx); queue_toplevel_callback(p->callback, p->callback_ctx);
ldisc_enable_prompt_callback(term->ldisc, NULL); if (term->ldisc)
ldisc_enable_prompt_callback(term->ldisc, NULL);
p->spr = spr; p->spr = spr;
return spr; return spr;
} }