wez             Mon Apr 18 12:22:38 2005 EDT

  Modified files:              (Branch: PHP_5_0)
    /php-src    NEWS 
    /php-src/ext/com_dotnet     com_handlers.c 
  Log:
  Fix bugs #29583 and #31636
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.328&r2=1.1760.2.329&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.328 php-src/NEWS:1.1760.2.329
--- php-src/NEWS:1.1760.2.328   Sun Apr 17 12:26:30 2005
+++ php-src/NEWS        Mon Apr 18 12:22:36 2005
@@ -27,11 +27,13 @@
 - Fixed bug #32282 (Segfault in mysqli_fetch_array on 64-bit) (Georg).
 - Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP 
   response message). (Jani)
+- Fixed bug #31636 (another crash when echoing a COM object). (Wez)
 - Fixed bug #31502 (Wrong deserialization from session when using WDDX
   serializer). (Dmitry) 
 - Fixed bug #31363 (broken non-blocking flock()). ian at snork dot net
 - Fixed bug #30833 (array_count_values() modifying input array). (Tony)
 - Fixed bug #30819 (Better support for LDAP SASL bind). (Jani)
+- Fixed bug #29583 (crash when echoing a COM object). (M.Sisolak, Wez)
 - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)).
   (kameshj at fastmail dot fm)
 
http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_handlers.c?r1=1.22.2.3&r2=1.22.2.4&ty=u
Index: php-src/ext/com_dotnet/com_handlers.c
diff -u php-src/ext/com_dotnet/com_handlers.c:1.22.2.3 
php-src/ext/com_dotnet/com_handlers.c:1.22.2.4
--- php-src/ext/com_dotnet/com_handlers.c:1.22.2.3      Thu Nov 25 15:28:37 2004
+++ php-src/ext/com_dotnet/com_handlers.c       Mon Apr 18 12:22:38 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_handlers.c,v 1.22.2.3 2004/11/25 20:28:37 zeev Exp $ */
+/* $Id: com_handlers.c,v 1.22.2.4 2005/04/18 16:22:38 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -524,14 +524,15 @@
        php_com_dotnet_object *obj;
        VARIANT v;
        VARTYPE vt = VT_EMPTY;
+       zval free_obj;
+       HRESULT res = S_OK;
 
        if (should_free) {
-               zval_dtor(writeobj);
+               free_obj = *writeobj;
        }
 
-       ZVAL_NULL(writeobj);
-
        obj = CDNO_FETCH(readobj);
+       ZVAL_NULL(writeobj);
        VariantInit(&v);
 
        if (V_VT(&obj->v) == VT_DISPATCH) {
@@ -564,12 +565,23 @@
        }
 
        if (vt != VT_EMPTY) {
-               VariantChangeType(&v, &v, 0, vt);
+               res = VariantChangeType(&v, &v, 0, vt);
+       }
+
+       if (SUCCEEDED(res)) {
+               php_com_zval_from_variant(writeobj, &v, obj->code_page 
TSRMLS_CC);
        }
 
-       php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC);
        VariantClear(&v);
-       return SUCCESS;
+       if (should_free) {
+               zval_dtor(&free_obj);
+       }
+
+       if (SUCCEEDED(res)) {
+               return SUCCESS;
+       }
+
+       return FAILURE;
 }
 
 static int com_object_count(zval *object, long *count TSRMLS_DC)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to