summaryrefslogtreecommitdiff
path: root/mysys_ssl
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-06-19 18:05:10 +0200
committerSergei Golubchik <serg@mariadb.org>2015-06-27 09:40:54 +0200
commite7620ce4ce93c9c449b6d4ccffb7a6054a40deb4 (patch)
treefe8447205be014c9c8c9728a1ebb4ebe57de0430 /mysys_ssl
parente20be69eccff6d300ea27c508591dcc47e18932a (diff)
downloadmariadb-git-e7620ce4ce93c9c449b6d4ccffb7a6054a40deb4.tar.gz
MDEV-8281 aes_decrypt crashes in block_crypt()
fix aes_decrypt of yassl to support zero-length input
Diffstat (limited to 'mysys_ssl')
-rw-r--r--mysys_ssl/my_crypt.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys_ssl/my_crypt.cc b/mysys_ssl/my_crypt.cc
index 9f37883a9b8..dc3c4f63bdb 100644
--- a/mysys_ssl/my_crypt.cc
+++ b/mysys_ssl/my_crypt.cc
@@ -104,7 +104,7 @@ static int block_crypt(CipherMode cipher, Dir dir,
}
else
{
- int n= dest[source_length - 1];
+ int n= source_length ? dest[source_length - 1] : 0;
if (tail || n == 0 || n > MY_AES_BLOCK_SIZE)
return MY_AES_BAD_DATA;
*dest_length-= n;