diff options
author | Sergey Glukhov <sergey.glukhov@oracle.com> | 2011-03-28 11:53:18 +0400 |
---|---|---|
committer | Sergey Glukhov <sergey.glukhov@oracle.com> | 2011-03-28 11:53:18 +0400 |
commit | d499851be03a2a20f7cb230d9b2d69e169aa81c8 (patch) | |
tree | 34c536aba575ebcc9c2a27bd666d70071fc73656 /sql/item_timefunc.cc | |
parent | f1b638d33cdf95b70fa925cce304864c96fdf7ee (diff) | |
download | mariadb-git-d499851be03a2a20f7cb230d9b2d69e169aa81c8.tar.gz |
Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ...
Valgrind warining happens due to missing
'end of the string' check. The fix is to
check if we reached the end of the string.
mysql-test/r/func_time.result:
test case
mysql-test/t/func_time.test:
test case
sql/item_timefunc.cc:
check if we reached the end of
the string after leading spaces skipping.
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 6335199b8de..71b2baf4fee 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -294,8 +294,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, for (; ptr != end && val != val_end; ptr++) { /* Skip pre-space between each argument */ - while (val != val_end && my_isspace(cs, *val)) - val++; + if ((val+= cs->cset->scan(cs, val, val_end, MY_SEQ_SPACES)) >= val_end) + break; if (*ptr == '%' && ptr+1 != end) { |