diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-10-25 12:57:36 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-10-25 12:57:36 +0300 |
commit | 19ceaf2928bbd562e3fd5eabecd8ca69fdf062b6 (patch) | |
tree | 88c378a716b01193fedcbac207908a34e465f3c8 /strings | |
parent | 7457181ba43870ca9a619d74b7614b868f0a7511 (diff) | |
parent | 790a74d22beeadbd75dcc84dca03b3b450acd8bf (diff) | |
download | mariadb-git-19ceaf2928bbd562e3fd5eabecd8ca69fdf062b6.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-simple.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 9b13be5aaa2..1c382de5e28 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, SkySQL Ab. + Copyright (c) 2009, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1726,10 +1726,20 @@ exp: /* [ E [ <sign> ] <unsigned integer> ] */ goto ret_sign; } } - for (exponent= 0 ; - str < end && (ch= (uchar) (*str - '0')) < 10; - str++) + if (shift > 0 && !negative_exp) + goto ret_too_big; + for (exponent= 0 ; str < end && (ch= (uchar) (*str - '0')) < 10; str++) { + if (negative_exp) + { + if (exponent - shift > DIGITS_IN_ULONGLONG) + goto ret_zero; + } + else + { + if (exponent + shift > DIGITS_IN_ULONGLONG) + goto ret_too_big; + } exponent= exponent * 10 + ch; } shift+= negative_exp ? -exponent : exponent; |