summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-02-27 23:35:37 +0800
committerXinchen Hui <laruence@php.net>2015-02-27 23:35:37 +0800
commit794a28832dcfe59fc1ad82a8dda8e3b569ed5637 (patch)
tree85995b472f0b14d9e7e448a1529e60ace7177453
parent8f5676f73e57345b61447a27bc493b1b8f95ab5b (diff)
parent4119879a3905cb1b089f475e8a0471717f7049b3 (diff)
downloadphp-git-794a28832dcfe59fc1ad82a8dda8e3b569ed5637.tar.gz
Merge branch 'PHP-5.6'
Conflicts: ext/soap/soap.c
-rw-r--r--ext/soap/soap.c6
-rw-r--r--ext/soap/tests/bugs/bug69085.phpt17
2 files changed, 20 insertions, 3 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 63de00049b..3a27f7a7b4 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2581,7 +2581,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
}
if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL &&
- Z_LVAL_P(trace) > 0) {
+ Z_TYPE_P(trace) == IS_LONG && Z_LVAL_P(trace) > 0) {
add_property_stringl(this_ptr, "__last_request", buf, buf_size);
}
@@ -2609,7 +2609,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
}
ret = FALSE;
} else if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL &&
- Z_LVAL_P(trace) > 0) {
+ Z_TYPE_P(trace) == IS_LONG && Z_LVAL_P(trace) > 0) {
add_property_str(this_ptr, "__last_response", zend_string_copy(Z_STR_P(response)));
}
zval_ptr_dtor(&func);
@@ -2909,7 +2909,7 @@ PHP_METHOD(SoapClient, __call)
/* Add default headers */
this_ptr = getThis();
- if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) != NULL) {
+ if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) != NULL && Z_TYPE_P(tmp) == IS_ARRAY) {
HashTable *default_headers = Z_ARRVAL_P(tmp);
if (soap_headers) {
if (!free_soap_headers) {
diff --git a/ext/soap/tests/bugs/bug69085.phpt b/ext/soap/tests/bugs/bug69085.phpt
new file mode 100644
index 0000000000..cb27cfd89e
--- /dev/null
+++ b/ext/soap/tests/bugs/bug69085.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #69085 (SoapClient's __call() type confusion through unserialize())
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+
+$dummy = unserialize('O:10:"SoapClient":5:{s:3:"uri";s:1:"a";s:8:"location";s:22:"http://localhost/a.xml";s:17:"__default_headers";i:1337;s:15:"__last_response";s:1:"a";s:5:"trace";s:1:"x";}');
+try {
+ $dummy->whatever();
+} catch (Exception $e) {
+ echo "okey";
+}
+--EXPECT--
+okey