summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorSergey Glukhov <sergey.glukhov@oracle.com>2011-04-15 12:51:34 +0400
committerSergey Glukhov <sergey.glukhov@oracle.com>2011-04-15 12:51:34 +0400
commit12a6e0d90eee9784199092d72887204d23fb92f9 (patch)
tree73afec6d837b899a2cc3b67d3ceff28bb3077d61 /sql/sql_load.cc
parent2af655c2e59e505390e90039d9c47fbc0fdaf493 (diff)
downloadmariadb-git-12a6e0d90eee9784199092d72887204d23fb92f9.tar.gz
Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
Some multibyte sequences could be considered by my_mbcharlen() functions as multibyte character but more exact my_ismbchar() does not think so. In such a case this multibyte sequences is pushed into 'stack' buffer which is too small to accommodate the sequence. The fix is to allocate stack buffer in compliance with max character length.
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index c227fe69b62..513cd62b510 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1109,7 +1109,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
/* Set of a stack for unget if long terminators */
- uint length=max(field_term_length,line_term_length)+1;
+ uint length= max(cs->mbmaxlen, max(field_term_length, line_term_length)) + 1;
set_if_bigger(length,line_start.length());
stack=stack_pos=(int*) sql_alloc(sizeof(int)*length);