Skip to content

Commit acdee16

Browse files
author
Chandan Kunal
committed
Merge branch 'mysql-5.6' into mysql-5.7
2 parents fedfdd7 + 52d9daf commit acdee16

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

strings/ctype-simple.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ my_strntoull10rnd_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
15601560
str++;
15611561
if (str < end)
15621562
{
1563-
int negative_exp, exponent;
1563+
longlong negative_exp, exponent;
15641564
if ((negative_exp= (*str == '-')) || *str=='+')
15651565
{
15661566
if (++str == end)
@@ -1570,7 +1570,10 @@ my_strntoull10rnd_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
15701570
str < end && (ch= (uchar) (*str - '0')) < 10;
15711571
str++)
15721572
{
1573-
exponent= exponent * 10 + ch;
1573+
if (exponent <= (LLONG_MAX - ch) / 10)
1574+
exponent= exponent * 10 + ch;
1575+
else
1576+
goto ret_too_big;
15741577
}
15751578
shift+= negative_exp ? -exponent : exponent;
15761579
}

0 commit comments

Comments
 (0)