From: simon Date: Tue, 13 Nov 2012 21:34:12 +0000 (+0000) Subject: When manually initialising a 'struct RSAKey' due to loading an SSH1 X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/commitdiff_plain/a1e50b70a5fbeb472d136794e052f02266571fcf When manually initialising a 'struct RSAKey' due to loading an SSH1 public key but not the private half, NULL out all the CRT-optimisation fields as well as the private exponent pointer. Otherwise segfaults - security-harmless, but annoying - can happen in freersakey() when we notice they aren't null and try to free them. git-svn-id: svn://svn.tartarus.org/sgt/putty@9705 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/cmdgen.c b/cmdgen.c index 86a548e3..254ae6a7 100644 --- a/cmdgen.c +++ b/cmdgen.c @@ -763,6 +763,9 @@ int main(int argc, char **argv) } ssh1key->comment = dupstr(origcomment); ssh1key->private_exponent = NULL; + ssh1key->p = NULL; + ssh1key->q = NULL; + ssh1key->iqmp = NULL; } else { ret = loadrsakey(infilename, ssh1key, passphrase, &error); }