Don't copy from a nonexistent next. Coverity ID 47.
authorBen Laurie <ben@openssl.org>
Thu, 5 Apr 2007 17:23:51 +0000 (17:23 +0000)
committerBen Laurie <ben@openssl.org>
Thu, 5 Apr 2007 17:23:51 +0000 (17:23 +0000)
crypto/evp/bio_md.c

index f4c0a7298101d0a3e4ab2aff67110ab2cc4c9c25..231b56b65db59ca0f00fa727379d19aeae4eacd8 100644 (file)
@@ -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);
        }