summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-10-21 19:00:42 +0200
committerSergei Golubchik <serg@mariadb.org>2019-10-23 15:55:23 +0200
commit790a74d22beeadbd75dcc84dca03b3b450acd8bf (patch)
treeb5a778ac8b3d5e63c9dea27780e1c224e9b6e3ac /strings
parentae702d76438d15c84e0e113031366b0a8da47b9f (diff)
parent719ac0ad4af0dd1e20dbc94eff8f8c9f786b3393 (diff)
downloadmariadb-git-790a74d22beeadbd75dcc84dca03b3b450acd8bf.tar.gz
Merge branch 'github/5.5' into 10.1
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 20c7f81dbf4..5cbf5da7990 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
@@ -1622,10 +1622,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;