diff options
author | Andrey Hristov <andrey@php.net> | 2010-05-03 16:20:46 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2010-05-03 16:20:46 +0000 |
commit | f9fe805abecc95ea07c5e4bdab213e75db049cc5 (patch) | |
tree | df1908c83657b56049541173f8833b007f7754df /ext/mysqlnd/mysqlnd_wireprotocol.c | |
parent | 864f2da7338c8a4f4b20facd74bc7f60f46afb76 (diff) | |
download | php-git-f9fe805abecc95ea07c5e4bdab213e75db049cc5.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.c | 4 |
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 */ |