diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 16:24:47 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 16:24:47 +0200 |
commit | 133b4b46fefde402542214d8226262534dc3601a (patch) | |
tree | 51bbdc0ee35a4af61e5af6d97948963ae9354f39 /strings | |
parent | 44836bcd12e3974e79c928be747955bfb3b73910 (diff) | |
parent | 533a13af069d8c9e6c5f4e1a72851497185ade03 (diff) | |
download | mariadb-git-133b4b46fefde402542214d8226262534dc3601a.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-bin.c | 4 | ||||
-rw-r--r-- | strings/ctype-tis620.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 84e5c85697b..c11be2e5926 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -1,6 +1,6 @@ /* Copyright (c) 2002-2007 MySQL AB & tommy@valley.ne.jp Copyright (c) 2002, 2014, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, SkySQL Ab. + Copyright (c) 2009, 2020, MariaDB Corporation. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -401,7 +401,7 @@ my_strnxfrm_8bit_bin(CHARSET_INFO *cs, { set_if_smaller(srclen, dstlen); set_if_smaller(srclen, nweights); - if (dst != src) + if (srclen && dst != src) memcpy(dst, src, srclen); return my_strxfrm_pad_desc_and_reverse(cs, dst, dst + srclen, dst + dstlen, (uint)(nweights - srclen), flags, 0); diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 90773a0dabc..1a5dd6dbfde 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -555,9 +555,11 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), alloced= a= (uchar*) my_malloc(PSI_INSTRUMENT_ME, a_length+b_length+2, MYF(MY_FAE)); b= a + a_length+1; - memcpy((char*) a, (char*) a0, a_length); + if (a_length) + memcpy((char*) a, (char*) a0, a_length); a[a_length]= 0; /* if length(a0)> len1, need to put 'end of string' */ - memcpy((char *)b, (char *)b0, b_length); + if (b_length) + memcpy((char *)b, (char *)b0, b_length); b[b_length]= 0; /* put end of string */ a_length= thai2sortable(a, a_length); b_length= thai2sortable(b, b_length); |