summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2017-01-02 14:57:32 +0000
committerJoe Watkins <krakjoe@php.net>2017-01-02 14:58:19 +0000
commitdfb6cdb61792f1525e7014305e5f31dd313da264 (patch)
tree26a1cafffd217e18bbbc158b16f7b99e05f6a6ee
parenta5b49fdcb0c98ec4a9a20b5720480f4e8867acf5 (diff)
parentabba56f60522e8f5449c11f780409b7227d022d0 (diff)
downloadphp-git-dfb6cdb61792f1525e7014305e5f31dd313da264.tar.gz
Merge branch 'PHP-7.1'
* PHP-7.1: Fix for sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE news entry for PR #2249
-rw-r--r--NEWS4
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index d08f67ac88..955decacf4 100644
--- a/NEWS
+++ b/NEWS
@@ -66,6 +66,10 @@ PHP NEWS
- Mcrypt:
. The deprecated mcrypt extension has been moved to PECL. (leigh)
+- mysqlnd:
+ . Fixed bug #73800 (sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE).
+ (vanviegen)
+
- PDO:
. Add "Sent SQL" to debug dump for emulated prepares. (Adam Baratz)
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 03fcad9877..b057a44e82 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1477,7 +1477,12 @@ php_mysqlnd_read_row_ex(MYSQLND_PFC * pfc,
zero-length byte, don't read the body, there is no such.
*/
- *data_size = 0;
+ /*
+ We're allocating an extra byte, as php_mysqlnd_rowp_read_text_protocol_aux
+ needs to be able to append a terminating \0 for atoi/atof.
+ */
+ *data_size = 1;
+
while (1) {
if (FAIL == mysqlnd_read_header(pfc, vio, &header, stats, error_info)) {
ret = FAIL;
@@ -1526,6 +1531,7 @@ php_mysqlnd_read_row_ex(MYSQLND_PFC * pfc,
pool->free_chunk(pool, *buffer);
*buffer = NULL;
}
+ *data_size--;
DBG_RETURN(ret);
}
/* }}} */