summaryrefslogtreecommitdiffstats
path: root/crypto/evp/bio_md.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-09-23 23:43:49 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-09-23 23:43:49 +0000
commitb6dcdbfc94c482f6c15ba725754fc9e827e41851 (patch)
tree9fec84d4564530bc97b42d56e01a64abb96adac3 /crypto/evp/bio_md.c
parentcd4f7cddc7994d23d48b86cf638541c6e2310c2d (diff)
Audit libcrypto for unchecked return values: fix all cases enountered
Diffstat (limited to 'crypto/evp/bio_md.c')
-rw-r--r--crypto/evp/bio_md.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c
index 9841e32e1a..144fdfd56a 100644
--- a/crypto/evp/bio_md.c
+++ b/crypto/evp/bio_md.c
@@ -153,8 +153,12 @@ static int md_write(BIO *b, const char *in, int inl)
{
if (ret > 0)
{
- EVP_DigestUpdate(ctx,(const unsigned char *)in,
- (unsigned int)ret);
+ if (!EVP_DigestUpdate(ctx,(const unsigned char *)in,
+ (unsigned int)ret))
+ {
+ BIO_clear_retry_flags(b);
+ return 0;
+ }
}
}
if(b->next_bio != NULL)
@@ -220,7 +224,8 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
case BIO_CTRL_DUP:
dbio=ptr;
dctx=dbio->ptr;
- EVP_MD_CTX_copy_ex(dctx,ctx);
+ if (!EVP_MD_CTX_copy_ex(dctx,ctx))
+ return 0;
b->init=1;
break;
default: