From e99cd73fed21152a2cea8d43cd76d33eda408b08 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 19 Jan 2005 23:30:38 +0000 Subject: [PATCH] Add an assertion so that short-rsa2-key-crash at least avoids segfaulting while we come up with a better solution. git-svn-id: svn://svn.tartarus.org/sgt/putty@5146 cda61777-01e9-0310-a592-d414129be87e --- sshrsa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sshrsa.c b/sshrsa.c index baec83e0..4f95fb38 100644 --- a/sshrsa.c +++ b/sshrsa.c @@ -802,6 +802,7 @@ static unsigned char *rsa2_sign(void *key, char *data, int datalen, SHA_Simple(data, datalen, hash); nbytes = (bignum_bitcount(rsa->modulus) - 1) / 8; + assert(1 <= nbytes - 20 - ASN1_LEN); bytes = snewn(nbytes, unsigned char); bytes[0] = 1; -- 2.11.0