diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2021-02-04 14:43:17 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2021-02-05 13:09:59 +0100 |
commit | 3f8d21b9226493365cbb9f913322f5da6965c974 (patch) | |
tree | 7a337d7d0ee722137e19f3c8c616cd0d30436cde /ext/mysqlnd/mysqlnd_wireprotocol.c | |
parent | 8b7aaad7d65779b1d6497436b4e7da52f53d159c (diff) | |
download | php-git-3f8d21b9226493365cbb9f913322f5da6965c974.tar.gz |
Fix #74779: x() and y() truncating floats to integers
We must not use the locale dependent `atof()`, but instead use the
(hopefully) locale independent `zend_strtod()`, when converting string
representations of floating point numbers which are sent by the server.
Closes GH-6665.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_wireprotocol.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_wireprotocol.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 216f420698..072fdde97a 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1679,7 +1679,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_ROW_BUFFER * row_buffer, zval * zend_uchar save = *(p + len); /* We have to make it ASCIIZ temporarily */ *(p + len) = '\0'; - ZVAL_DOUBLE(current_field, atof((char *) p)); + ZVAL_DOUBLE(current_field, zend_strtod((char *) p, NULL)); *(p + len) = save; } #endif /* MYSQLND_STRING_TO_INT_CONVERSION */ |