Exit the loop on failure

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2805)
This commit is contained in:
Jon Spillett 2017-03-01 14:22:21 +10:00 committed by Rich Salz
parent b35fb005bd
commit f125430063

View File

@ -212,7 +212,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl)
wrmax = inl;
ret = BIO_write(next, in, wrmax);
if (ret <= 0)
break;
goto done;
wrlen += ret;
ctx->copylen -= ret;
in += ret;