summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_wireprotocol.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-05-03 16:20:46 +0000
committerAndrey Hristov <andrey@php.net>2010-05-03 16:20:46 +0000
commitc32bae720cb6b85a7fb89eed52b2ec60ac4b2127 (patch)
tree7c1e90f37051487fa525bc2cd0ec753bc538122f /ext/mysqlnd/mysqlnd_wireprotocol.c
parentec0fe858c6b04741e20425b8045e3e558ab51303 (diff)
downloadphp-git-c32bae720cb6b85a7fb89eed52b2ec60ac4b2127.tar.gz
Handle OOM in block_alloc_get_chunk, and also in the caller
in mysqlnd_wireprotocol.c
Diffstat (limited to 'ext/mysqlnd/mysqlnd_wireprotocol.c')
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 9896788dd1..75391d390a 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1136,6 +1136,10 @@ php_mysqlnd_read_row_ex(MYSQLND * conn, MYSQLND_MEMORY_POOL * result_set_memory_
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);
+ if (!*buffer) {
+ ret = FAIL;
+ break;
+ }
p = (*buffer)->ptr;
} else if (!first_iteration) {
/* Empty packet after MYSQLND_MAX_PACKET_SIZE packet. That's ok, break */