[Commits] d85168e: Correct length check in my_wc_mb_filename()

Jan Lindström jan.lindstrom at mariadb.com
Mon Dec 7 09:20:55 EET 2015


revision-id: d85168e40d12de12c119b98ea92c35f3c2fe1f3f (mariadb-5.5.46-15-gd85168e)
parent(s): e528fe79b8479000e1e4ed20de1682bc385ad82a
committer: Jan Lindström
timestamp: 2015-12-07 09:20:31 +0200
message:

Correct length check in my_wc_mb_filename()

---
 mysql-test/r/ctype_filename.result | 3 +++
 mysql-test/t/ctype_filename.test   | 3 +++
 strings/ctype-utf8.c               | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/mysql-test/r/ctype_filename.result b/mysql-test/r/ctype_filename.result
index acc32c7..ac8df47 100644
--- a/mysql-test/r/ctype_filename.result
+++ b/mysql-test/r/ctype_filename.result
@@ -11,3 +11,6 @@ create table com1 (a int);
 drop table com1;
 create table `clock$` (a int);
 drop table `clock$`;
+select convert(convert(',' using filename) using binary);
+convert(convert(',' using filename) using binary)
+ at 002c
diff --git a/mysql-test/t/ctype_filename.test b/mysql-test/t/ctype_filename.test
index 436ccfc..4c501a8 100644
--- a/mysql-test/t/ctype_filename.test
+++ b/mysql-test/t/ctype_filename.test
@@ -19,3 +19,6 @@ drop table com1;
 
 create table `clock$` (a int);
 drop table `clock$`;
+
+select convert(convert(',' using filename) using binary);
+
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index edcac27..2dd7f5e 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -4585,7 +4585,7 @@ my_wc_mb_filename(CHARSET_INFO *cs __attribute__((unused)),
   }
 
   /* Non letter */
-  if (s + 5 > e)
+  if (s + 4 > e)
     return MY_CS_TOOSMALL5;
 
   *s++= hex[(wc >> 12) & 15];


More information about the commits mailing list