com php-src: Fixed wrong usage of old ZPP API.: ext/curl/interface.c ext/curl/multi.c ext/filter/logical_filters.c ext/filter/ sanitizing_filters.c
ext/intl/converter/converter.c e xt/intl/dateformat/dateformat_parse.c ext/intl/grapheme/g rapheme_string.c ext/intl/spoofchecker/spoofchecker_mai n.c
ext/soap/soap.c ext/sysvmsg/sysvmsg.c
| From: | Dmitry Stogov | Date: | Mon, 19 Jun 2017 15:08:50 +0000 |
| Subject: | com php-src: Fixed wrong usage of old ZPP API.: ext/curl/interface.c ext/curl/multi.c ext/filter/logical_filters.c ext/filter/ sanitizing_filters.c ext/intl/converter/converter.c e xt/intl/dateformat/dateformat_parse.c ext/intl/grapheme/g rapheme_string.c ext/intl/spoofchecker/spoofchecker_mai n.c ext/soap/soap.c ext/sysvmsg/sysvmsg.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98101@lists.php.net to get a copy of this message | ||
Commit: 40ecad34022b6e687cc654d47c88f8cef5d418fd
Author: Dmitry Stogov <dmitry@zend.com> Mon, 19 Jun 2017 18:08:50 +0300
Parents: e511f152f43d597fda9f3ceb0b03c20cb3fe4d2d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=40ecad34022b6e687cc654d47c88f8cef5d418fd
Log:
Fixed wrong usage of old ZPP API.
Changed paths:
M ext/curl/interface.c
M ext/curl/multi.c
M ext/filter/logical_filters.c
M ext/filter/sanitizing_filters.c
M ext/intl/converter/converter.c
M ext/intl/dateformat/dateformat_parse.c
M ext/intl/grapheme/grapheme_string.c
M ext/intl/spoofchecker/spoofchecker_main.c
M ext/soap/soap.c
M ext/sysvmsg/sysvmsg.c
Diff:
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 21f1f71..3684222 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2111,7 +2111,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /*
{{{
CURLcode error = CURLE_OK;
zend_long lval;
- ZVAL_DEREF(zvalue);
switch (option) {
/* Long options */
case CURLOPT_SSL_VERIFYHOST:
@@ -2989,6 +2988,7 @@ PHP_FUNCTION(curl_setopt_array)
"Array keys must be CURLOPT constants or equivalent integer values");
RETURN_FALSE;
}
+ ZVAL_DEREF(entry);
if (_php_curl_setopt(ch, (zend_long) option, entry) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index 322fd82..d45802f 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -339,7 +339,7 @@ PHP_FUNCTION(curl_multi_info_read)
RETURN_FALSE;
}
if (zmsgs_in_queue) {
- zval_dtor(zmsgs_in_queue);
+ zval_ptr_dtor(zmsgs_in_queue);
ZVAL_LONG(zmsgs_in_queue, queued_msgs);
}
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 4a01f31..c203adc 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -314,7 +314,7 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (ret == -1) {
RETURN_VALIDATION_FAILED
} else {
- zval_dtor(value);
+ zval_ptr_dtor(value);
ZVAL_BOOL(value, ret);
}
}
diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c
index a4bcc0f..299902f 100644
--- a/ext/filter/sanitizing_filters.c
+++ b/ext/filter/sanitizing_filters.c
@@ -213,7 +213,7 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL)
Z_STRLEN_P(value) = new_len;
if (new_len == 0) {
- zval_dtor(value);
+ zval_ptr_dtor(value);
if (flags & FILTER_FLAG_EMPTY_STRING_NULL) {
ZVAL_NULL(value);
} else {
@@ -293,7 +293,7 @@ void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL)
php_filter_encode_html(value, enc);
} else if (flags & FILTER_FLAG_EMPTY_STRING_NULL && Z_STRLEN_P(value) == 0) {
- zval_dtor(value);
+ zval_ptr_dtor(value);
ZVAL_NULL(value);
}
}
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index ede61fc..f3201c7 100644
--- a/ext/intl/converter/converter.c
+++ b/ext/intl/converter/converter.c
@@ -62,7 +62,7 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr
/* {{{ php_converter_default_callback */
static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval
*error) {
ZVAL_DEREF(error);
- zval_dtor(error);
+ zval_ptr_dtor(error);
ZVAL_LONG(error, U_ZERO_ERROR);
/* Basic functionality so children can call parent::toUCallback() */
switch (reason) {
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c
index a833177..0e2290f 100644
--- a/ext/intl/dateformat/dateformat_parse.c
+++ b/ext/intl/dateformat/dateformat_parse.c
@@ -135,7 +135,7 @@ PHP_FUNCTION(datefmt_parse)
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z/!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!",
&object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) ==
FAILURE ){
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input
params", 0 );
RETURN_FALSE;
@@ -145,7 +145,6 @@ PHP_FUNCTION(datefmt_parse)
DATE_FORMAT_METHOD_FETCH_OBJECT;
if (z_parse_pos) {
- ZVAL_DEREF(z_parse_pos);
convert_to_long(z_parse_pos);
if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) {
intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR);
@@ -159,7 +158,7 @@ PHP_FUNCTION(datefmt_parse)
}
internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL,
return_value);
if(z_parse_pos) {
- zval_dtor(z_parse_pos);
+ zval_ptr_dtor(z_parse_pos);
ZVAL_LONG(z_parse_pos, parse_pos);
}
}
@@ -189,7 +188,6 @@ PHP_FUNCTION(datefmt_localtime)
DATE_FORMAT_METHOD_FETCH_OBJECT;
if (z_parse_pos) {
- ZVAL_DEREF(z_parse_pos);
convert_to_long(z_parse_pos);
if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) {
intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR);
@@ -203,7 +201,7 @@ PHP_FUNCTION(datefmt_localtime)
}
internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL,
return_value);
if (z_parse_pos) {
- zval_dtor(z_parse_pos);
+ zval_ptr_dtor(z_parse_pos);
ZVAL_LONG(z_parse_pos, parse_pos);
}
}
diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c
index 91d5741..fd03279 100644
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@ -804,8 +804,7 @@ PHP_FUNCTION(grapheme_extract)
} else {
ZVAL_DEREF(next);
/* initialize next */
- SEPARATE_ZVAL_NOREF(next);
- zval_dtor(next);
+ zval_ptr_dtor(next);
ZVAL_LONG(next, lstart);
}
}
diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c
index cb26905..5e1d75d 100644
--- a/ext/intl/spoofchecker/spoofchecker_main.c
+++ b/ext/intl/spoofchecker/spoofchecker_main.c
@@ -46,7 +46,7 @@ PHP_METHOD(Spoofchecker, isSuspicious)
}
if (error_code) {
- zval_dtor(error_code);
+ zval_ptr_dtor(error_code);
ZVAL_LONG(error_code, ret);
}
RETVAL_BOOL(ret != 0);
@@ -81,7 +81,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
}
if (error_code) {
- zval_dtor(error_code);
+ zval_ptr_dtor(error_code);
ZVAL_LONG(error_code, ret);
}
RETVAL_BOOL(ret != 0);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index c874629..68b6130 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2952,6 +2952,7 @@ PHP_METHOD(SoapClient, __call)
} ZEND_HASH_FOREACH_END();
}
if (output_headers) {
+ zval_ptr_dtor(output_headers);
array_init(output_headers);
}
do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value,
location, soap_action, uri, soap_headers, output_headers);
diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c
index 37aa0d9..8fc7643 100644
--- a/ext/sysvmsg/sysvmsg.c
+++ b/ext/sysvmsg/sysvmsg.c
@@ -469,6 +469,7 @@ PHP_FUNCTION(msg_send)
if (result == -1) {
php_error_docref(NULL, E_WARNING, "msgsnd failed: %s", strerror(errno));
if (zerror) {
+ zval_ptr_dtor(zerror);
ZVAL_LONG(zerror, errno);
}
} else {