summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_wireprotocol.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-06-23 22:58:09 +0800
committerXinchen Hui <laruence@php.net>2014-06-23 22:58:09 +0800
commit305da4a88ab1b9a8405c843bf519a19fd039152b (patch)
tree72fbe5f945f7a5370faf1e386a75b8964897c651 /ext/mysqlnd/mysqlnd_wireprotocol.c
parentba45650d632f2116178ec282deda98bc65d9b09c (diff)
downloadphp-git-305da4a88ab1b9a8405c843bf519a19fd039152b.tar.gz
We don't need extra 1 byte anymore
Diffstat (limited to 'ext/mysqlnd/mysqlnd_wireprotocol.c')
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 8cdd712f0b..9beac3d0b2 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1397,11 +1397,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
if (first_iteration) {
first_iteration = FALSE;
- /*
- We need a trailing \0 for the last string, in case of text-mode,
- to be able to implement read-only variables. Thus, we add + 1.
- */
- *buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size + 1 TSRMLS_CC);
+ *buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size TSRMLS_CC);
if (!*buffer) {
ret = FAIL;
break;
@@ -1415,11 +1411,8 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
/*
We have to realloc the buffer.
-
- We need a trailing \0 for the last string, in case of text-mode,
- to be able to implement read-only variables.
*/
- if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size + 1 TSRMLS_CC)) {
+ if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size TSRMLS_CC)) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
break;