]> granicus.if.org Git - php/commitdiff
Check the pointer before calling a function on it, or we will crash.
authorAndrey Hristov <andrey@php.net>
Thu, 11 Jun 2009 08:32:34 +0000 (08:32 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 11 Jun 2009 08:32:34 +0000 (08:32 +0000)
This is a very rare situation where the server is totally broken.

ext/mysqlnd/mysqlnd_wireprotocol.c

index 2924827e9c00cdcdc809dbb5dca2f20d040909bd..bec4fde410e8a234e2b73a319afe056d4a4b61bf 100644 (file)
@@ -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;
        }