diff --git a/crypto/dsa/dsa_asn1.c b/crypto/dsa/dsa_asn1.c index f2818f3ab6c36b7318d6bfc9607beaf5cc4e672f..f79e1d1404a5ce811abefe3c9b82731bc20bd2f6 100644 --- a/crypto/dsa/dsa_asn1.c +++ b/crypto/dsa/dsa_asn1.c @@ -34,6 +34,8 @@ void DSA_SIG_get0(BIGNUM **pr, BIGNUM **ps, const DSA_SIG *sig) int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s) { + if (r == NULL || s == NULL) + return 0; BN_clear_free(sig->r); BN_clear_free(sig->s); sig->r = r; diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c index 9bc4ca7b27125a804f4edde545e189e940e2682b..9f7e8373083b6c85fc6b3029219bf9140029970d 100644 --- a/crypto/ec/ec_asn1.c +++ b/crypto/ec/ec_asn1.c @@ -1182,6 +1182,8 @@ void ECDSA_SIG_get0(BIGNUM **pr, BIGNUM **ps, const ECDSA_SIG *sig) int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) { + if (r == NULL || s == NULL) + return 0; BN_clear_free(sig->r); BN_clear_free(sig->s); sig->r = r;