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

Windows Pageant: add a missing null-pointer check (maybe).

Coverity complained in keylist_update_callback that in one if
statement I was allowing for the possibility that alg == NULL, and in
the next, I was assuming it would always be non-null.

Right now I'm not actually convinced that _either_ check is necessary
- it would make sense in an agent _client_, where you might be talking
to an agent that knows key algorithms you don't, but this is the GUI
built into Pageant itself, so any key it can store internally ought to
have a known algorithm name.

Still, this fix is certainly _correct_ even if not optimal, and it'll
do for now.
This commit is contained in:
Simon Tatham 2022-09-07 14:45:35 +01:00
parent ebaa37e159
commit 8c72a9daa4

View File

@ -375,7 +375,7 @@ static void keylist_update_callback(
}
ptrlen bits_word = ptrlen_get_word(&fingerprint, " ");
if (ssh_keyalg_variable_size(alg))
if (alg && ssh_keyalg_variable_size(alg))
put_datapl(disp->bits, bits_word);
put_datapl(disp->hash, ptrlen_get_word(&fingerprint, " "));