From 5dbc41447d4c6b8dfd9c7a8928c1e0c618326f9f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 28 May 2011 00:55:47 +0000 Subject: [PATCH] fixed build issue --- src/rsa.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rsa.cpp b/src/rsa.cpp index fb0c9de2d..67a646e00 100644 --- a/src/rsa.cpp +++ b/src/rsa.cpp @@ -95,11 +95,12 @@ bool generate_rsa_keys(char* public_key, int* public_len if (keypair == 0) return false; bool ret = false; + unsigned char* pub = (unsigned char*)public_key; + unsigned char* priv = (unsigned char*)private_key; + if (RSA_size(keypair) > *public_len) goto getout; if (RSA_size(keypair) > *private_len) goto getout; - unsigned char* pub = (unsigned char*)public_key; - unsigned char* priv = (unsigned char*)private_key; *public_len = i2d_RSAPublicKey(keypair, &pub); *private_len = i2d_RSAPrivateKey(keypair, &priv);