From 6ea511211ce190cc336e94ccde7723fadf0b5a07 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sat, 5 Jul 2014 22:32:39 +0100 Subject: Only cleanse sbuf if it is not NULL. PR#2339 --- fips/rsa/fips_rsa_sign.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fips/rsa/fips_rsa_sign.c b/fips/rsa/fips_rsa_sign.c index a4e03e7417..4956971f04 100644 --- a/fips/rsa/fips_rsa_sign.c +++ b/fips/rsa/fips_rsa_sign.c @@ -288,8 +288,11 @@ int FIPS_rsa_sign_digest(RSA *rsa, const unsigned char *md, int md_len, *siglen=j; } psserr: - OPENSSL_cleanse(sbuf, i); - OPENSSL_free(sbuf); + if (sbuf) + { + OPENSSL_cleanse(sbuf, i); + OPENSSL_free(sbuf); + } return ret; } -- cgit v1.2.1