summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-10-31 10:58:06 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-10-31 10:58:06 +0100
commit55b2281a5da38f66dca5e2180672f570c33676df (patch)
tree9cbb719b71ff8f29e657ff1d468f4270c714d5b5 /strings
parentd6d621cec18251b55202bbd362315b3c1ed90181 (diff)
parent259edb1f60b5d4e9061a81e90c5a8ec9d0741751 (diff)
downloadmariadb-git-55b2281a5da38f66dca5e2180672f570c33676df.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-simple.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 3124bf8fc96..91232a1e31f 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;