summaryrefslogtreecommitdiff
path: root/lib/libcrypto/evp/encode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/evp/encode.c')
-rw-r--r--lib/libcrypto/evp/encode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libcrypto/evp/encode.c b/lib/libcrypto/evp/encode.c
index 12c6379df18..08209357ce0 100644
--- a/lib/libcrypto/evp/encode.c
+++ b/lib/libcrypto/evp/encode.c
@@ -136,6 +136,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
*outl=0;
if (inl == 0) return;
+ OPENSSL_assert(ctx->length <= sizeof ctx->enc_data);
if ((ctx->num+inl) < ctx->length)
{
memcpy(&(ctx->enc_data[ctx->num]),in,inl);
@@ -258,6 +259,7 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
/* only save the good data :-) */
if (!B64_NOT_BASE64(v))
{
+ OPENSSL_assert(n < sizeof ctx->enc_data);
d[n++]=tmp;
ln++;
}