]> granicus.if.org Git - php/commitdiff
Stepping back to PHP 5.2.x and earlier logic of allocating even huge pieces of memory...
authorUlf Wendel <uw@php.net>
Fri, 11 Sep 2009 12:28:47 +0000 (12:28 +0000)
committerUlf Wendel <uw@php.net>
Fri, 11 Sep 2009 12:28:47 +0000 (12:28 +0000)
Library (libmysql). The test does pass with mysqlnd because mysqlnd does not have any issues here.

ext/mysqli/mysqli_api.c

index f69f6e76341cb6e4fa7f568ea065357df7d9c15e..7d367e670c05597a4c0682f8691083a976101aac 100644 (file)
@@ -395,7 +395,9 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc,
                                          different lengths and you will see that we get different lengths in stmt->stmt->fields[ofs].length
                                          The just take 256 and saves us from realloc-ing.
                                        */
-                                       stmt->result.buf[ofs].buflen = 256;
+                                       stmt->result.buf[ofs].buflen =
+                                               (stmt->stmt->fields) ? (stmt->stmt->fields[ofs].length) ? stmt->stmt->fields[ofs].length + 1: 256: 256;
+
                                } else {
                                        /*
                                                the user has called store_result(). if he does not there is no way to determine the