diff options
author | Andrey Hristov <andrey@php.net> | 2010-05-25 23:18:13 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2010-05-25 23:18:13 +0000 |
commit | 433cb868d65545f021a63d994febae21a1abe8aa (patch) | |
tree | acac0ce2dd034c27b0b88d7bd149c38d35ce937d /ext/mysqlnd/mysqlnd_result.c | |
parent | f4f5a5075199e1e976301de1863ceda007b25b66 (diff) | |
download | php-git-433cb868d65545f021a63d994febae21a1abe8aa.tar.gz |
Handle the situation when MYSQLND_PROTOCOL's methods return NULL.
mysqlnd should not crash but gracefully return with an error.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_result.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_result.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 00368aaa0f..5590375763 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -493,6 +493,11 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT * s TSRMLS_DC) /* Check for SERVER_STATUS_MORE_RESULTS if needed */ fields_eof = conn->protocol->m.get_eof_packet(conn->protocol, FALSE TSRMLS_CC); + if (!fields_eof) { + SET_OOM_ERROR(conn->error_info); + ret = FAIL; + break; + } if (FAIL == (ret = PACKET_READ(fields_eof, conn))) { DBG_ERR("Error ocurred while reading the EOF packet"); result->m.free_result_contents(result TSRMLS_CC); |