php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #73800
Patch mysqlnd-segfault-atoi.diff revision 2016-12-21 15:55 UTC by php at vanviegen dot net

Patch mysqlnd-segfault-atoi.diff for MySQLi related Bug #73800

Patch version 2016-12-21 15:55 UTC

Return to Bug #73800 | Download this patch
Patch Revisions:

Developer: php@vanviegen.net

diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 9f2aafab..84f363b 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1443,7 +1443,13 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
 	zend_bool first_iteration = TRUE;
 
 	DBG_ENTER("php_mysqlnd_read_row_ex");
-
+	
+	/*
+	 * We're allocating 1 extra byte, as php_mysqlnd_rowp_read_text_protocol_aux
+	 * needs to be able to add a terminating \0 for atoi/atof.
+	 */
+	prealloc_more_bytes++;
+	
 	/*
 	  To ease the process the server splits everything in packets up to 2^24 - 1.
 	  Even in the case the payload is evenly divisible by this value, the last
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 06:01:28 2024 UTC