Merge pull request #8696 from gemu2015/chartofloat_limit

fix chartofloat digit overflow
This commit is contained in:
Theo Arends 2020-06-15 09:26:51 +02:00 committed by GitHub
commit 82b4029eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -167,6 +167,8 @@ float CharToFloat(const char *str)
float right = 0;
if (*pt == '.') {
pt++;
// limit decimals to float max
pt[7]=0;
right = atoi(pt); // Decimal part
while (isdigit(*pt)) {
pt++;
@ -1908,4 +1910,4 @@ String Decompress(const char * compressed, size_t uncompressed_size) {
return content;
}
#endif // USE_UNISHOX_COMPRESSION
#endif // USE_UNISHOX_COMPRESSION