From: Andrey Hristov Date: Thu, 11 Jun 2009 08:32:34 +0000 (+0000) Subject: Check the pointer before calling a function on it, or we will crash. X-Git-Tag: php-5.4.0alpha1~191^2~3360 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f90ebd669f7a361a6ffa0df6a5b8724397dce04;p=php 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 2924827e9c..bec4fde410 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1344,7 +1344,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; }