Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2022-09-07 16:45:35 +0300
committerSimon Tatham <anakin@pobox.com>2022-09-07 16:47:54 +0300
commit8c72a9daa4fffe989d6d342838f650a923058a86 (patch)
tree394b6a3a08ef6388da8e4bacb536f2e579d67cce /windows
parentebaa37e1590e77644aa5d0c9a85506f18b9bf38b (diff)
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.
Diffstat (limited to 'windows')
-rw-r--r--windows/pageant.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/windows/pageant.c b/windows/pageant.c
index 60040310..d1368903 100644
--- a/windows/pageant.c
+++ b/windows/pageant.c
@@ -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, " "));