diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-04-07 13:59:02 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-04-07 13:59:02 +0400 |
commit | 5a274915ecc10b5e926b2167ee45765affdab727 (patch) | |
tree | b27bd8361f4b5418724f82dd5ab573a30e1b540c /strings | |
parent | 58d8bfab4f10c7f6163d23d08bf79db21016eb07 (diff) | |
download | mariadb-git-5a274915ecc10b5e926b2167ee45765affdab727.tar.gz |
Bug #52165: Assertion failed: file .\dtoa.c, line 465
The failing assertion was written with the assumption that a NULL
string can never be passed to my_strtod(). However, an empty string
may be passed under some circumstances by passing str == NULL and
*end == NULL.
Fixed the assertion to take the above case into account.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/dtoa.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/strings/dtoa.c b/strings/dtoa.c index 88e0d9272a8..75a05be2c56 100644 --- a/strings/dtoa.c +++ b/strings/dtoa.c @@ -462,7 +462,9 @@ double my_strtod(const char *str, char **end, int *error) { char buf[DTOA_BUFF_SIZE]; double res; - DBUG_ASSERT(str != NULL && end != NULL && *end != NULL && error != NULL); + DBUG_ASSERT(end != NULL && ((str != NULL && *end != NULL) || + (str == NULL && *end == NULL)) && + error != NULL); res= my_strtod_int(str, end, error, buf, sizeof(buf)); return (*error == 0) ? res : (res < 0 ? -DBL_MAX : DBL_MAX); |