Exit the loop on failure
authorJon Spillett <jon.spillett@oracle.com>
Wed, 1 Mar 2017 04:22:21 +0000 (14:22 +1000)
committerRich Salz <rsalz@openssl.org>
Thu, 9 Mar 2017 14:26:13 +0000 (09:26 -0500)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2805)

crypto/asn1/bio_asn1.c

index 3d3f8e4c1ef310fbaf1673647b6ae3e5053b0854..31fd7258a9ab2c7494cb4a7141bbbeedb9a0236f 100644 (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;