diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c index f4c0a7298..231b56b65 100644 --- a/crypto/evp/bio_md.c +++ b/crypto/evp/bio_md.c @@ -157,8 +157,11 @@ static int md_write(BIO *b, const char *in, int inl) (unsigned int)ret); } } - BIO_clear_retry_flags(b); - BIO_copy_next_retry(b); + if(b->next_bio != NULL) + { + BIO_clear_retry_flags(b); + BIO_copy_next_retry(b); + } return(ret); }