diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-05-08 12:41:45 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-05-08 13:07:24 +0200 |
commit | e84c62d59b8036138998b0e521a47bdde4ac3875 (patch) | |
tree | 688f827a22ec1acd2c8ebc9e7834bedc216050e8 /sql/session_tracker.cc | |
parent | 1d1fb13e59a410f4097802be7076c90b1bca695b (diff) | |
download | mariadb-git-e84c62d59b8036138998b0e521a47bdde4ac3875.tar.gz |
MDEV-22504: Session tracking return incorrectly long traking data
When we move data we should fix buffer string length
Diffstat (limited to 'sql/session_tracker.cc')
-rw-r--r-- | sql/session_tracker.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc index 7538295fcea..b73bd1d1d4a 100644 --- a/sql/session_tracker.cc +++ b/sql/session_tracker.cc @@ -1698,7 +1698,7 @@ void Session_tracker::store(THD *thd, String *buf) if ((size= net_length_size(length)) != 1) { - if (buf->reserve(size - 1, EXTRA_ALLOC)) + if (buf->reserve(size - 1, 0)) { buf->length(start); // it is safer to have 0-length block in case of error return; @@ -1708,6 +1708,7 @@ void Session_tracker::store(THD *thd, String *buf) The 'buf->reserve()' can change the buf->ptr() so we cannot calculate the 'data' earlier. */ + buf->length(buf->length() + (size - 1)); data= (uchar *)(buf->ptr() + start); memmove(data + (size - 1), data, length); } |