From 37278b3bfc64cd41b3992078a72d20b5e52dd475 Mon Sep 17 00:00:00 2001 From: Ben Harris 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. [originally from svn r5146] --- 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;