Skip to content

Commit 86ba1a2

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
2 parents 5789035 + 997b7e5 commit 86ba1a2

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

ext/soap/soap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
25632563
}
25642564

25652565
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
2566-
Z_LVAL_PP(trace) > 0) {
2566+
Z_TYPE_PP(trace) == IS_LONG && Z_LVAL_PP(trace) > 0) {
25672567
add_property_stringl(this_ptr, "__last_request", buf, buf_size, 1);
25682568
}
25692569

@@ -2598,7 +2598,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
25982598
}
25992599
ret = FALSE;
26002600
} else if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
2601-
Z_LVAL_PP(trace) > 0) {
2601+
Z_TYPE_PP(trace) == IS_LONG && Z_LVAL_PP(trace) > 0) {
26022602
add_property_stringl(this_ptr, "__last_response", Z_STRVAL_P(response), Z_STRLEN_P(response), 1);
26032603
}
26042604
zval_ptr_dtor(&params[4]);
@@ -2903,7 +2903,7 @@ PHP_METHOD(SoapClient, __call)
29032903
}
29042904

29052905
/* Add default headers */
2906-
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &tmp)==SUCCESS) {
2906+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_ARRAY) {
29072907
HashTable *default_headers = Z_ARRVAL_P(*tmp);
29082908
if (soap_headers) {
29092909
if (!free_soap_headers) {

ext/soap/tests/bugs/bug69085.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Bug #69085 (SoapClient's __call() type confusion through unserialize())
3+
--SKIPIF--
4+
<?php require_once('skipif.inc'); ?>
5+
--INI--
6+
soap.wsdl_cache_enabled=0
7+
--FILE--
8+
<?php
9+
10+
$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";}');
11+
try {
12+
$dummy->whatever();
13+
} catch (Exception $e) {
14+
echo "okey";
15+
}
16+
--EXPECT--
17+
okey

0 commit comments

Comments
 (0)