From 5a76218eddf186def6dc566d6e8b07c1e47ffb83 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Wed, 4 Aug 2004 13:02:40 +0000 Subject: [PATCH] fixed bug #29522 --- ext/mysqli/mysqli.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index d9ef90dd43..10edca186b 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -200,6 +200,13 @@ zval *mysqli_read_property(zval *object, zval *member, int type TSRMLS_DC) ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); } if (ret == SUCCESS) { + /* check if connection is still valid */ + if (!obj->ptr || + !((MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql)->thread_id) { + retval = EG(uninitialized_zval_ptr); + return(retval); + } + ret = hnd->read_func(obj, &retval TSRMLS_CC); if (ret == SUCCESS) { /* ensure we're creating a temporary variable */ -- 2.50.1