components/php-5_3/php-sapi/patches/091_php_pdo_stmt_race.patch
branchs11-update
changeset 2923 d19580922ffe
parent 846 fe258446a1ae
equal deleted inserted replaced
2922:a20504fc0f7b 2923:d19580922ffe
       
     1 6911348 back port pdo race bug for opensolaris
       
     2 6909525 PDO race condition fix for multithreaded php
       
     3 which states:
       
     4 There is a race condition in pdo which was found when running olio inside Sun Web Server (nsapi).
       
     5 http://bugs.php.net/bug.php?id=49937&thanks=1
       
     6 
       
     7 Fix has been submitted but because of lack of reviewer it has not been committed into php tree.
       
     8 
       
     9 We need to carry this patch until it is merged.
       
    10 
       
    11 
     1 --- php-5.3.10/ext/pdo/pdo_stmt.c_orig	Sun Jan  1 05:15:04 2012
    12 --- php-5.3.10/ext/pdo/pdo_stmt.c_orig	Sun Jan  1 05:15:04 2012
     2 +++ php-5.3.10/ext/pdo/pdo_stmt.c	Wed Feb  8 11:25:26 2012
    13 +++ php-5.3.10/ext/pdo/pdo_stmt.c	Wed Feb  8 11:25:26 2012
     3 @@ -2322,6 +2322,51 @@
    14 @@ -2322,6 +2322,51 @@
     4  	return -1;
    15  	return -1;
     5  }
    16  }
    63  	
    74  	
    64 @@ -2466,7 +2511,7 @@
    75 @@ -2466,7 +2511,7 @@
    65  	stmt->refcount = 1;
    76  	stmt->refcount = 1;
    66  	ALLOC_HASHTABLE(stmt->properties);
    77  	ALLOC_HASHTABLE(stmt->properties);
    67  	zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
    78  	zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
    68 -	zend_hash_copy(stmt->properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
    79 -	zend_hash_copy(stmt->properties, &ce->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
    69 +	init_stmt_properties(stmt TSRMLS_CC);
    80 +	init_stmt_properties(stmt TSRMLS_CC);
    70  
    81  
    71  	retval.handle = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbstmt_free_storage, (zend_objects_store_clone_t)dbstmt_clone_obj TSRMLS_CC);
    82  	retval.handle = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbstmt_free_storage, (zend_objects_store_clone_t)dbstmt_clone_obj TSRMLS_CC);
    72  	retval.handlers = &pdo_dbstmt_object_handlers;
    83  	retval.handlers = &pdo_dbstmt_object_handlers;