diff options
author | Andrey Hristov <andrey@php.net> | 2010-05-03 14:16:04 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2010-05-03 14:16:04 +0000 |
commit | de4a5156e69fe4b5de6ff3146ff4a50f2dec5abb (patch) | |
tree | 288009eb0b2a18839b5526d31eb7b66190a9c849 /ext/mysqlnd/mysqlnd_wireprotocol.c | |
parent | 8fd0407b3ab509796932458e3dd37c6b82952107 (diff) | |
download | php-git-de4a5156e69fe4b5de6ff3146ff4a50f2dec5abb.tar.gz |
Handle OOM when resizing blocks during data fetch
Diffstat (limited to 'ext/mysqlnd/mysqlnd_wireprotocol.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_wireprotocol.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 3eb9159227..6e0adf5620 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1149,7 +1149,11 @@ php_mysqlnd_read_row_ex(MYSQLND * conn, MYSQLND_MEMORY_POOL * result_set_memory_ We need a trailing \0 for the last string, in case of text-mode, to be able to implement read-only variables. */ - (*buffer)->resize_chunk((*buffer), *data_size + 1 TSRMLS_CC); + if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size + 1 TSRMLS_CC)) { + SET_OOM_ERROR(conn->error_info); + ret = FAIL; + break; + } /* The position could have changed, recalculate */ p = (*buffer)->ptr + (*data_size - header.size); } |