summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_result.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-05-04 14:02:42 +0000
committerAndrey Hristov <andrey@php.net>2010-05-04 14:02:42 +0000
commitebae62d7c42442a576da3ed5917be74a239f36ed (patch)
treeb4826ca773da95b93c423f08f8ab523243461010 /ext/mysqlnd/mysqlnd_result.c
parent04d24bde20f1374d73fc88853bae4320d5573461 (diff)
downloadphp-git-ebae62d7c42442a576da3ed5917be74a239f36ed.tar.gz
OOM stability fixes
Diffstat (limited to 'ext/mysqlnd/mysqlnd_result.c')
-rw-r--r--ext/mysqlnd/mysqlnd_result.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
index 26e05ac7f7..02380457f8 100644
--- a/ext/mysqlnd/mysqlnd_result.c
+++ b/ext/mysqlnd/mysqlnd_result.c
@@ -359,9 +359,16 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT * s TSRMLS_DC)
DBG_INF_FMT("stmt=%d", stmt? stmt->stmt_id:0);
ret = FAIL;
- rset_header = conn->protocol->m.get_rset_header_packet(conn->protocol, FALSE TSRMLS_CC);
do {
+ rset_header = conn->protocol->m.get_rset_header_packet(conn->protocol, FALSE TSRMLS_CC);
+ if (!rset_header) {
+ SET_OOM_ERROR(conn->error_info);
+ ret = FAIL;
+ break;
+ }
+
SET_ERROR_AFF_ROWS(conn);
+
if (FAIL == (ret = PACKET_READ(rset_header, conn))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading result set's header");
break;