Skip to content

Commit dfb6cdb

Browse files
committed
Merge branch 'PHP-7.1'
* PHP-7.1: Fix for sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE news entry for PR #2249
2 parents a5b49fd + abba56f commit dfb6cdb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ PHP NEWS
6666
- Mcrypt:
6767
. The deprecated mcrypt extension has been moved to PECL. (leigh)
6868

69+
- mysqlnd:
70+
. Fixed bug #73800 (sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE).
71+
(vanviegen)
72+
6973
- PDO:
7074
. Add "Sent SQL" to debug dump for emulated prepares. (Adam Baratz)
7175

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,12 @@ php_mysqlnd_read_row_ex(MYSQLND_PFC * pfc,
14771477
zero-length byte, don't read the body, there is no such.
14781478
*/
14791479

1480-
*data_size = 0;
1480+
/*
1481+
We're allocating an extra byte, as php_mysqlnd_rowp_read_text_protocol_aux
1482+
needs to be able to append a terminating \0 for atoi/atof.
1483+
*/
1484+
*data_size = 1;
1485+
14811486
while (1) {
14821487
if (FAIL == mysqlnd_read_header(pfc, vio, &header, stats, error_info)) {
14831488
ret = FAIL;
@@ -1526,6 +1531,7 @@ php_mysqlnd_read_row_ex(MYSQLND_PFC * pfc,
15261531
pool->free_chunk(pool, *buffer);
15271532
*buffer = NULL;
15281533
}
1534+
*data_size--;
15291535
DBG_RETURN(ret);
15301536
}
15311537
/* }}} */

0 commit comments

Comments
 (0)