From 3f8d21b9226493365cbb9f913322f5da6965c974 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 4 Feb 2021 14:43:17 +0100 Subject: 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. --- ext/mysqlnd/mysqlnd_wireprotocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/mysqlnd') 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 */ -- cgit v1.2.1