1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Fix crash on entering wrong passphrase.

When I added the new call to ssh_key_invalid the other day, I forgot
to avoid calling it if the key is NULL (and therefore even more
obviously invalid).
This commit is contained in:
Simon Tatham 2019-02-11 20:20:50 +00:00
parent 8957e613bc
commit 75dda5e86f

View File

@ -853,22 +853,22 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
s->suppress_wait_for_response_packet = true; s->suppress_wait_for_response_packet = true;
break; /* try something else */ break; /* try something else */
} }
} } else {
/* FIXME: if we ever support variable signature
/* FIXME: if we ever support variable signature * flags, this is somewhere they'll need to be
* flags, this is somewhere they'll need to be * put */
* put */ char *invalid = ssh_key_invalid(key->key, 0);
char *invalid = ssh_key_invalid(key->key, 0); if (invalid) {
if (invalid) { ppl_printf("Cannot use this private key (%s)\r\n",
ppl_printf("Cannot use this private key (%s)\r\n", invalid);
invalid); ssh_key_free(key->key);
ssh_key_free(key->key); sfree(key->comment);
sfree(key->comment); sfree(key);
sfree(key); sfree(invalid);
sfree(invalid); key = NULL;
key = NULL; s->suppress_wait_for_response_packet = true;
s->suppress_wait_for_response_packet = true; break; /* try something else */
break; /* try something else */ }
} }
} }