cvs: php-src(PHP_5_2) /ext/curl multi.c

From: Date: Fri, 15 Sep 2006 15:04:59 +0000
Subject: cvs: php-src(PHP_5_2) /ext/curl multi.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-40530@lists.php.net to get a copy of this message
tony2001 Fri Sep 15 15:04:59 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/curl multi.c Log: MFH: fix segfault in curl_multi_info_read() http://cvs.php.net/viewvc.cgi/php-src/ext/curl/multi.c?r1=1.19.2.3.2.3&r2=1.19.2.3.2.4&diff_format=u Index: php-src/ext/curl/multi.c diff -u php-src/ext/curl/multi.c:1.19.2.3.2.3 php-src/ext/curl/multi.c:1.19.2.3.2.4 --- php-src/ext/curl/multi.c:1.19.2.3.2.3 Mon Sep 4 16:31:27 2006 +++ php-src/ext/curl/multi.c Fri Sep 15 15:04:59 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: multi.c,v 1.19.2.3.2.3 2006/09/04 16:31:27 iliaa Exp $ */ +/* $Id: multi.c,v 1.19.2.3.2.4 2006/09/15 15:04:59 tony2001 Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -62,7 +62,7 @@ mh = ecalloc(1, sizeof(php_curlm)); mh->multi = curl_multi_init(); - zend_llist_init(&mh->easyh, sizeof(zval *), (llist_dtor_func_t) NULL, 0); + zend_llist_init(&mh->easyh, sizeof(zval), (llist_dtor_func_t) NULL, 0); ZEND_REGISTER_RESOURCE(return_value, mh, le_curl_multi_handle); } @@ -250,12 +250,12 @@ { zend_llist_position pos; php_curl *ch; - zval **pz_ch; + zval *pz_ch; /* search the list of easy handles hanging off the multi-handle */ - for(pz_ch = (zval **)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch; - pz_ch = (zval **)zend_llist_get_next_ex(&mh->easyh, &pos)) { - ZEND_FETCH_RESOURCE(ch, php_curl *, pz_ch, -1, le_curl_name, le_curl); + for(pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch; + pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) { + ZEND_FETCH_RESOURCE(ch, php_curl *, &pz_ch, -1, le_curl_name, le_curl); if (ch->cp == tmp_msg->easy_handle) { /* we are adding a reference to the underlying php_curl @@ -266,12 +266,12 @@ SEPARATE_ZVAL, but those create new zvals, which is already being done in add_assoc_resource */ - zend_list_addref( Z_RESVAL_PP( pz_ch ) ); + zend_list_addref( Z_RESVAL_P( pz_ch ) ); /* add_assoc_resource automatically creates a new zval to wrap the "resource" represented by the current pz_ch */ - add_assoc_resource(return_value, "handle", Z_RESVAL_PP(pz_ch)); + add_assoc_resource(return_value, "handle", Z_RESVAL_P(pz_ch)); break; }

« previous php.cvs (#40530) next »