diff options
author | Monty <monty@mariadb.org> | 2020-03-17 12:37:56 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-03-17 12:37:56 +0200 |
commit | 517f659e6d5eeb7e01bf19ef8b782bc2619831d4 (patch) | |
tree | 5e3c9aba88ccf22257bda48d3d2cd2e80b7eafc3 /client | |
parent | a2d24def8cc42d27c72d833abfb39ef24a2b96ba (diff) | |
download | mariadb-git-517f659e6d5eeb7e01bf19ef8b782bc2619831d4.tar.gz |
Fixed that caused failure in --ps binlog_encryption.rpl_gtid_basic
Problem was that replace_dynstr_append_mem() assumed strings are
null terminated which is not always the case.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index bb59e5fd42f..4cda66ab087 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -11145,13 +11145,16 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val, size_t len) { /* Convert to lower case, and do this first */ char *c= lower; - for (const char *v= val; *v; v++) + for (const char *v= val, *end_v= v + len; v < end_v; v++) *c++= my_tolower(charset_info, *v); *c= '\0'; /* Copy from this buffer instead */ } else - memcpy(lower, val, len+1); + { + memcpy(lower, val, len); + lower[len]= 0; + } fix_win_paths(lower, len); val= lower; } |