summaryrefslogtreecommitdiff
path: root/mysys_ssl
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-05-28 20:03:44 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2019-05-28 20:04:12 +0200
commit1df42a2ca0d9788829939ad7fbfe20601d008830 (patch)
treea4c9b1bd7d87978a1abd6d05984cda2338f84acb /mysys_ssl
parent5e36f5dd00d706baea7af623f09711d66ba0109c (diff)
downloadmariadb-git-1df42a2ca0d9788829939ad7fbfe20601d008830.tar.gz
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.
Diffstat (limited to 'mysys_ssl')
-rw-r--r--mysys_ssl/my_crypt.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/mysys_ssl/my_crypt.cc b/mysys_ssl/my_crypt.cc
index 383cec07ddd..e41ace49474 100644
--- a/mysys_ssl/my_crypt.cc
+++ b/mysys_ssl/my_crypt.cc
@@ -60,7 +60,16 @@ public:
}
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;