]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/evp/bio_b64.c
Change the return type of EVP_EncodeUpdate
[thirdparty/openssl.git] / crypto / evp / bio_b64.c
index 9067848578d369438050a2c4db380438a9f14829..32a884a711049d7f09e6611bdf83c941a3611e86 100644 (file)
@@ -403,9 +403,10 @@ static int b64_write(BIO *b, const char *in, int inl)
                 ret += n;
             }
         } else {
-            EVP_EncodeUpdate(ctx->base64,
-                             (unsigned char *)ctx->buf, &ctx->buf_len,
-                             (unsigned char *)in, n);
+            if (!EVP_EncodeUpdate(ctx->base64,
+                                 (unsigned char *)ctx->buf, &ctx->buf_len,
+                                 (unsigned char *)in, n))
+                return ((ret == 0) ? -1 : ret);
             OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
             OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
             ret += n;