]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
uxpgnt: fix an uninitialised structure field in find_key().
authorSimon Tatham <anakin@pobox.com>
Tue, 14 Feb 2017 20:26:03 +0000 (20:26 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 14 Feb 2017 23:25:25 +0000 (23:25 +0000)
Thanks, Coverity - I must have been lucky that Unix Pageant in client
mode hasn't so far happened to have this field come out non-NULL, or
else pageant_pubkey_copy would have tried to dupstr a garbage pointer.

unix/uxpgnt.c

index d0d69600a58014918d8d6a861ad13c2c4801286c..a4bc6b9389b0ff09e7b7bc7fdcc5dc9fa3ebf087 100644 (file)
@@ -551,6 +551,7 @@ struct pageant_pubkey *find_key(const char *string, char **retstr)
              * list things.
              */
             key_in.ssh_version = 1;
+            key_in.comment = NULL;
             key_ret = pageant_pubkey_copy(&key_in);
             sfree(key_in.blob);
             filename_free(fn);
@@ -577,6 +578,7 @@ struct pageant_pubkey *find_key(const char *string, char **retstr)
              * list things.
              */
             key_in.ssh_version = 2;
+            key_in.comment = NULL;
             key_ret = pageant_pubkey_copy(&key_in);
             sfree(key_in.blob);
             filename_free(fn);