From 26d98fc6febae09ed37a430bf24dd519593a5a4c Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 12 Sep 2004 22:02:06 +0000 Subject: [PATCH] `dwalin' spotted a NULL dereference in the new makekey() error handling. Oops. git-svn-id: svn://svn.tartarus.org/sgt/putty@4541 cda61777-01e9-0310-a592-d414129be87e --- sshrsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sshrsa.c b/sshrsa.c index f684c2af..baec83e0 100644 --- a/sshrsa.c +++ b/sshrsa.c @@ -54,7 +54,7 @@ int makekey(unsigned char *data, int len, struct RSAKey *result, } n = ssh1_read_bignum(p, len, result ? &result->modulus : NULL); - if (n < 0 || bignum_bitcount(result->modulus) == 0) return -1; + if (n < 0 || (result && bignum_bitcount(result->modulus) == 0)) return -1; if (result) result->bytes = n - 2; if (keystr) -- 2.11.0