Commit 1df42a2c authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-19617 Assertion `src' failed in MyCTX::update

Apprently, sometimes there will be null pointers with 0 length
passed to the MyCTX::update() function, and  will need to return
a valid buffer.

So weaken the assertion, and use a valid pointer for src if it was NULL.
parent 5e36f5dd
......@@ -60,7 +60,16 @@ class MyCTX
}
virtual int update(const uchar *src, uint slen, uchar *dst, uint *dlen)
{
DBUG_ASSERT(src);
#ifdef HAVE_WOLFSSL
// WolfSSL checks parameters and does not like NULL pointers to be passed to function below.
if (!src)
{
static const uchar dummy[MY_AES_BLOCK_SIZE];
DBUG_ASSERT(!slen);
src=dummy;
}
#endif
if (EVP_CipherUpdate(ctx, dst, (int*)dlen, src, slen) != 1)
return MY_AES_OPENSSL_ERROR;
return MY_AES_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment