rrichards               Sat Dec  9 10:52:09 2006 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/com_dotnet/tests       bug39606.phpt 

  Modified files:              
    /php-src/ext/com_dotnet     com_typeinfo.c 
  Log:
  fix heap corruption when adding/caching typelib (also fixes bug 39606)
  add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_typeinfo.c?r1=1.7.2.1.2.1&r2=1.7.2.1.2.2&diff_format=u
Index: php-src/ext/com_dotnet/com_typeinfo.c
diff -u php-src/ext/com_dotnet/com_typeinfo.c:1.7.2.1.2.1 
php-src/ext/com_dotnet/com_typeinfo.c:1.7.2.1.2.2
--- php-src/ext/com_dotnet/com_typeinfo.c:1.7.2.1.2.1   Fri Aug 25 12:01:57 2006
+++ php-src/ext/com_dotnet/com_typeinfo.c       Sat Dec  9 10:52:09 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_typeinfo.c,v 1.7.2.1.2.1 2006/08/25 12:01:57 edink Exp $ */
+/* $Id: com_typeinfo.c,v 1.7.2.1.2.2 2006/12/09 10:52:09 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -220,8 +220,8 @@
 /* Type-library stuff */
 void php_com_typelibrary_dtor(void *pDest)
 {
-       ITypeLib *Lib = (ITypeLib*)pDest;
-       ITypeLib_Release(Lib);
+       ITypeLib **Lib = (ITypeLib**)pDest;
+       ITypeLib_Release(*Lib);
 }
 
 PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
@@ -249,7 +249,7 @@
 
        if (TL) {
                if (SUCCESS == zend_ts_hash_update(&php_com_typelibraries,
-                               search_string, l+1, (void*)TL, 
sizeof(ITypeLib*), NULL)) {
+                               search_string, l+1, (void*)&TL, 
sizeof(ITypeLib*), NULL)) {
                        /* add a reference for the hash table */
                        ITypeLib_AddRef(TL);
                }

http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/tests/bug39606.phpt?view=markup&rev=1.1
Index: php-src/ext/com_dotnet/tests/bug39606.phpt
+++ php-src/ext/com_dotnet/tests/bug39606.phpt

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

Reply via email to