From: Andrey Hristov Date: Thu, 11 Jun 2009 08:35:47 +0000 (+0000) Subject: MFH: X-Git-Tag: php-5.3.0RC4~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cff09ba5dfb363be6f824de6c002d5de68574990;p=php MFH: Check the pointer before calling a function on it, or we will crash. This is a very rare situation where the server is totally broken. --- diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index c9cc38241e..abf04ad680 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1343,7 +1343,7 @@ php_mysqlnd_read_row_ex(MYSQLND *conn, MYSQLND_MEMORY_POOL_CHUNK **buffer, break; } } - if (ret == FAIL) { + if (ret == FAIL && (*buffer)) { (*buffer)->free_chunk((*buffer), TRUE TSRMLS_CC); *buffer = NULL; }