diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 19:11:36 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 19:11:36 +0200 |
commit | c498250888ec126fddda2867d1239b2a7734482f (patch) | |
tree | e308174c977c0981d8e36f6f9b791b1b266d0cb0 /sql/mf_iocache_encr.cc | |
parent | 09a1f0075a8d5752dd7b2940a20d86a040af1741 (diff) | |
parent | 1418439d3823fe059b41092af72ab32d5e7cd7ab (diff) | |
download | mariadb-git-bb-10.6-georg.tar.gz |
Merge 10.5 into 10.6mariadb-10.5.7bb-10.6-georg10.6-vatu
Diffstat (limited to 'sql/mf_iocache_encr.cc')
-rw-r--r-- | sql/mf_iocache_encr.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/mf_iocache_encr.cc b/sql/mf_iocache_encr.cc index 072c0a48269..63830ec620a 100644 --- a/sql/mf_iocache_encr.cc +++ b/sql/mf_iocache_encr.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2015, MariaDB + Copyright (c) 2015, 2020, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -85,7 +85,6 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count) do { - size_t copied; uint elength, wlength, length; uchar iv[MY_AES_BLOCK_SIZE]= {0}; @@ -116,11 +115,13 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count) DBUG_ASSERT(length <= info->buffer_length); - copied= MY_MIN(Count, (size_t)(length - pos_offset)); - - memcpy(Buffer, info->buffer + pos_offset, copied); - Count-= copied; - Buffer+= copied; + size_t copied= MY_MIN(Count, (size_t)(length - pos_offset)); + if (copied) + { + memcpy(Buffer, info->buffer + pos_offset, copied); + Count-= copied; + Buffer+= copied; + } info->read_pos= info->buffer + pos_offset + copied; info->read_end= info->buffer + length; |