From 318447bceb3aa2c50ac0081bdb4e917f8704e7da Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Tue, 8 Nov 2016 19:22:09 +0100 Subject: [PATCH] Missing BN_RECP_CTX field init. BN_RECP_CTX_new direclty use bn_init to avoid twice memset calls Reviewed-by: Kurt Roeckx Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1879) --- crypto/bn/bn_recp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/bn/bn_recp.c b/crypto/bn/bn_recp.c index e532b6e668..20585b9d4b 100644 --- a/crypto/bn/bn_recp.c +++ b/crypto/bn/bn_recp.c @@ -12,10 +12,9 @@ void BN_RECP_CTX_init(BN_RECP_CTX *recp) { + memset(recp, 0, sizeof(*recp)); bn_init(&(recp->N)); bn_init(&(recp->Nr)); - recp->num_bits = 0; - recp->flags = 0; } BN_RECP_CTX *BN_RECP_CTX_new(void) @@ -25,7 +24,8 @@ BN_RECP_CTX *BN_RECP_CTX_new(void) if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) return (NULL); - BN_RECP_CTX_init(ret); + bn_init(&(ret->N)); + bn_init(&(ret->Nr)); ret->flags = BN_FLG_MALLOCED; return (ret); } -- 2.25.1