Blame SOURCES/php-5.5.21-bug69085.patch

8bac60
Single patch merged from
8bac60
8bac60
From 997b7e56302710bb3db00b56d0629ac75d73a207 Mon Sep 17 00:00:00 2001
8bac60
From: Xinchen Hui <laruence@php.net>
8bac60
Date: Fri, 27 Feb 2015 23:32:32 +0800
8bac60
Subject: [PATCH] Fixed bug #69085 (SoapClient's __call() type confusion
8bac60
 through unserialize()).
8bac60
8bac60
From 0c136a2abd49298b66acb0cad504f0f972f5bfe8 Mon Sep 17 00:00:00 2001
8bac60
From: Dmitry Stogov <dmitry@zend.com>
8bac60
Date: Tue, 3 Mar 2015 09:44:46 +0300
8bac60
Subject: [PATCH] Added type checks
8bac60
8bac60
From c8eaca013a3922e8383def6158ece2b63f6ec483 Mon Sep 17 00:00:00 2001
8bac60
From: Dmitry Stogov <dmitry@zend.com>
8bac60
Date: Tue, 3 Mar 2015 10:43:48 +0300
8bac60
Subject: [PATCH] Added type checks
8bac60
8bac60
From 76c1ec5e96640e3076c105bde2cccfceb7557690 Mon Sep 17 00:00:00 2001
8bac60
From: Xinchen Hui <laruence@php.net>
8bac60
Date: Wed, 25 Mar 2015 12:07:25 +0800
8bac60
Subject: [PATCH] Bug #69293	NEW segfault when using
8bac60
 SoapClient::__setSoapHeader (bisected, regression)
8bac60
8bac60
From c61ceef7796b3967dd5e270245d33ba72ba055ee Mon Sep 17 00:00:00 2001
8bac60
From: Remi Collet <remi@php.net>
8bac60
Date: Mon, 13 Apr 2015 14:39:11 +0200
8bac60
Subject: [PATCH] fix type in fix for #69085
8bac60
8bac60
diff -ru /dev/shm/rcollet/BUILD/php-5.5.21/ext/soap/php_encoding.c /home/rcollet/sources/php-src/ext/soap/php_encoding.c
8bac60
--- a/ext/soap/php_encoding.c	2015-01-21 11:23:27.000000000 +0100
8bac60
+++ b/ext/soap/php_encoding.c	2015-04-14 13:37:46.108290466 +0200
8bac60
@@ -404,12 +404,15 @@
8bac60
 		encodePtr enc = NULL;
8bac60
 		HashTable *ht = Z_OBJPROP_P(data);
8bac60
 
8bac60
-		if (zend_hash_find(ht, "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE) {
8bac60
+		if (zend_hash_find(ht, "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE ||
8bac60
+		    Z_TYPE_PP(ztype) != IS_LONG) {
8bac60
 			soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property");
8bac60
 		}
8bac60
 
8bac60
-		if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) {
8bac60
-			if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS) {
8bac60
+		if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(zstype) == IS_STRING) {
8bac60
+			if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS &&
8bac60
+			    Z_TYPE_PP(zns) == IS_STRING) {
8bac60
 				enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype));
8bac60
 			} else {
8bac60
 				zns = NULL;
8bac60
@@ -445,8 +448,10 @@
8bac60
 		}
8bac60
 
8bac60
 		if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode != enc)) {
8bac60
-			if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS) {
8bac60
-				if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS) {
8bac60
+			if (zend_hash_find(ht, "enc_stype", sizeof("enc_stype"), (void **)&zstype) == SUCCESS &&
8bac60
+			    Z_TYPE_PP(zstype) == IS_STRING) {
8bac60
+				if (zend_hash_find(ht, "enc_ns", sizeof("enc_ns"), (void **)&zns) == SUCCESS &&
8bac60
+				    Z_TYPE_PP(zns) == IS_STRING) {
8bac60
 					set_ns_and_type_ex(node, Z_STRVAL_PP(zns), Z_STRVAL_PP(zstype));
8bac60
 				} else {
8bac60
 					set_ns_and_type_ex(node, NULL, Z_STRVAL_PP(zstype));
8bac60
@@ -454,10 +459,12 @@
8bac60
 			}
8bac60
 		}
8bac60
 
8bac60
-		if (zend_hash_find(ht, "enc_name", sizeof("enc_name"), (void **)&zname) == SUCCESS) {
8bac60
+		if (zend_hash_find(ht, "enc_name", sizeof("enc_name"), (void **)&zname) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(zname) == IS_STRING) {
8bac60
 			xmlNodeSetName(node, BAD_CAST(Z_STRVAL_PP(zname)));
8bac60
 		}
8bac60
-		if (zend_hash_find(ht, "enc_namens", sizeof("enc_namens"), (void **)&znamens) == SUCCESS) {
8bac60
+		if (zend_hash_find(ht, "enc_namens", sizeof("enc_namens"), (void **)&znamens) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(znamens) == IS_STRING) {
8bac60
 			xmlNsPtr nsp = encode_add_ns(node, Z_STRVAL_PP(znamens));
8bac60
 			xmlSetNs(node, nsp);
8bac60
 		}
8bac60
@@ -3640,18 +3647,21 @@
8bac60
 		    Z_OBJCE_PP(tmp) == soap_var_class_entry) {
8bac60
 			zval **ztype;
8bac60
 
8bac60
-			if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE) {
8bac60
+			if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE ||
8bac60
+			    Z_TYPE_PP(ztype) != IS_LONG) {
8bac60
 				soap_error0(E_ERROR,  "Encoding: SoapVar has no 'enc_type' property");
8bac60
 			}
8bac60
 			cur_type = Z_LVAL_PP(ztype);
8bac60
 
8bac60
-			if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_stype", sizeof("enc_stype"), (void **)&ztype) == SUCCESS) {
8bac60
+			if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_stype", sizeof("enc_stype"), (void **)&ztype) == SUCCESS &&
8bac60
+			    Z_TYPE_PP(ztype) == IS_STRING) {
8bac60
 				cur_stype = Z_STRVAL_PP(ztype);
8bac60
 			} else {
8bac60
 				cur_stype = NULL;
8bac60
 			}
8bac60
 
8bac60
-			if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_ns", sizeof("enc_ns"), (void **)&ztype) == SUCCESS) {
8bac60
+			if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_ns", sizeof("enc_ns"), (void **)&ztype) == SUCCESS &&
8bac60
+			    Z_TYPE_PP(ztype) == IS_STRING) {
8bac60
 				cur_ns = Z_STRVAL_PP(ztype);
8bac60
 			} else {
8bac60
 				cur_ns = NULL;
8bac60
diff -ru /dev/shm/rcollet/BUILD/php-5.5.21/ext/soap/php_http.c /home/rcollet/sources/php-src/ext/soap/php_http.c
8bac60
--- a/ext/soap/php_http.c	2015-01-21 11:23:27.000000000 +0100
8bac60
+++ b/ext/soap/php_http.c	2015-04-14 13:37:46.109290475 +0200
8bac60
@@ -36,14 +36,16 @@
8bac60
 {
8bac60
 	zval **login, **password;
8bac60
 
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS &&
8bac60
+	    Z_TYPE_PP(login) == IS_STRING) {
8bac60
 		unsigned char* buf;
8bac60
 		int len;
8bac60
 		smart_str auth = {0};
8bac60
 
8bac60
 		smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
8bac60
 		smart_str_appendc(&auth, ':');
8bac60
-		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_password", sizeof("_proxy_password"), (void **)&password) == SUCCESS) {
8bac60
+		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_password", sizeof("_proxy_password"), (void **)&password) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(password) == IS_STRING) {
8bac60
 			smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
8bac60
 		}
8bac60
 		smart_str_0(&auth);
8bac60
@@ -64,14 +66,16 @@
8bac60
 	zval **login, **password;
8bac60
 
8bac60
 	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS &&
8bac60
-			!zend_hash_exists(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"))) {
8bac60
+	    Z_TYPE_PP(login) == IS_STRING &&
8bac60
+	    !zend_hash_exists(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"))) {
8bac60
 		unsigned char* buf;
8bac60
 		int len;
8bac60
 		smart_str auth = {0};
8bac60
 
8bac60
 		smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
8bac60
 		smart_str_appendc(&auth, ':');
8bac60
-		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS) {
8bac60
+		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(password) == IS_STRING) {
8bac60
 			smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
8bac60
 		}
8bac60
 		smart_str_0(&auth);
8bac60
@@ -571,6 +575,7 @@
8bac60
 		}
8bac60
 		if (!http_1_1 ||
8bac60
 			(zend_hash_find(Z_OBJPROP_P(this_ptr), "_keep_alive", sizeof("_keep_alive"), (void **)&tmp) == SUCCESS &&
8bac60
+			 (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) &&
8bac60
 			 Z_LVAL_PP(tmp) == 0)) {
8bac60
 			smart_str_append_const(&soap_headers, "\r\n"
8bac60
 				"Connection: close\r\n");
8bac60
@@ -804,7 +809,8 @@
8bac60
 		}
8bac60
 
8bac60
 		/* Send cookies along with request */
8bac60
-		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS) {
8bac60
+		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(cookies) == IS_ARRAY) {
8bac60
 			zval **data;
8bac60
 			char *key;
8bac60
 			int i, n;
8bac60
@@ -847,7 +853,7 @@
8bac60
 		smart_str_append_const(&soap_headers, "\r\n");
8bac60
 		smart_str_0(&soap_headers);
8bac60
 		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
8bac60
-		    Z_LVAL_PP(trace) > 0) {
8bac60
+		    (Z_TYPE_PP(trace) == IS_BOOL || Z_TYPE_PP(trace) == IS_LONG) && Z_LVAL_PP(trace) != 0) {
8bac60
 			add_property_stringl(this_ptr, "__last_request_headers", soap_headers.c, soap_headers.len, 1);
8bac60
 		}
8bac60
 		smart_str_appendl(&soap_headers, request, request_size);
8bac60
@@ -892,7 +898,7 @@
8bac60
 		}
8bac60
 
8bac60
 		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
8bac60
-		    Z_LVAL_PP(trace) > 0) {
8bac60
+		    (Z_TYPE_PP(trace) == IS_BOOL || Z_TYPE_PP(trace) == IS_LONG) && Z_LVAL_PP(trace) != 0) {
8bac60
 			add_property_stringl(this_ptr, "__last_response_headers", http_headers, http_header_size, 1);
8bac60
 		}
8bac60
 
8bac60
@@ -941,7 +947,8 @@
8bac60
 		char *eqpos, *sempos;
8bac60
 		zval **cookies;
8bac60
 
8bac60
-		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == FAILURE) {
8bac60
+		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == FAILURE ||
8bac60
+		    Z_TYPE_PP(cookies) != IS_ARRAY) {
8bac60
 			zval *tmp_cookies;
8bac60
 			MAKE_STD_ZVAL(tmp_cookies);
8bac60
 			array_init(tmp_cookies);
8bac60
diff -ru /dev/shm/rcollet/BUILD/php-5.5.21/ext/soap/soap.c /home/rcollet/sources/php-src/ext/soap/soap.c
8bac60
--- a/ext/ext/soap/soap.c   2015-01-21 11:23:27.000000000 +0100
8bac60
+++ b/ext/soap/soap.c       2015-04-14 13:37:46.111290492 +0200
8bac60
@@ -930,6 +930,12 @@
8bac60
 
8bac60
 	zend_call_function(&fci, NULL TSRMLS_CC);
8bac60
 
8bac60
+	convert_to_string(faultcode);
8bac60
+	convert_to_string(faultstring);
8bac60
+	convert_to_string(file);
8bac60
+	convert_to_long(line);
8bac60
+	convert_to_string(trace);
8bac60
+
8bac60
 	len = spprintf(&str, 0, "SoapFault exception: [%s] %s in %s:%ld\nStack trace:\n%s",
8bac60
 	               Z_STRVAL_P(faultcode), Z_STRVAL_P(faultstring), Z_STRVAL_P(file), Z_LVAL_P(line),
8bac60
 	               Z_STRLEN_P(trace) ? Z_STRVAL_P(trace) : "#0 {main}\n");
8bac60
@@ -2071,8 +2077,7 @@
8bac60
 
8bac60
 	xmlDocDumpMemory(doc_return, &buf, &size);
8bac60
 
8bac60
-	zend_is_auto_global("_SERVER", sizeof("_SERVER") - 1 TSRMLS_CC);
8bac60
-	if (PG(http_globals)[TRACK_VARS_SERVER] &&
8bac60
+	if ((PG(http_globals)[TRACK_VARS_SERVER] || zend_is_auto_global("_SERVER", sizeof("_SERVER") - 1 TSRMLS_CC)) &&
8bac60
 		zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name) == SUCCESS &&
8bac60
 		Z_TYPE_PP(agent_name) == IS_STRING) {
8bac60
 		if (strncmp(Z_STRVAL_PP(agent_name), "Shockwave Flash", sizeof("Shockwave Flash")-1) == 0) {
8bac60
@@ -2565,7 +2570,7 @@
8bac60
 	}
8bac60
 
8bac60
 	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
8bac60
-	    Z_LVAL_PP(trace) > 0) {
8bac60
+	    (Z_TYPE_PP(trace) == IS_BOOL || Z_TYPE_PP(trace) == IS_LONG) && Z_LVAL_PP(trace) != 0) {
8bac60
 		add_property_stringl(this_ptr, "__last_request", buf, buf_size, 1);
8bac60
 	}
8bac60
 
8bac60
@@ -2600,7 +2605,7 @@
8bac60
 		}
8bac60
 		ret = FALSE;
8bac60
 	} else if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
8bac60
-	    Z_LVAL_PP(trace) > 0) {
8bac60
+	           (Z_TYPE_PP(trace) == IS_BOOL || Z_TYPE_PP(trace) == IS_LONG) && Z_LVAL_PP(trace) != 0) {
8bac60
 		add_property_stringl(this_ptr, "__last_response", Z_STRVAL_P(response), Z_STRLEN_P(response), 1);
8bac60
 	}
8bac60
 	zval_ptr_dtor(&params[4]);
8bac60
@@ -2644,13 +2649,13 @@
8bac60
 
8bac60
 	SOAP_CLIENT_BEGIN_CODE();
8bac60
 
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS
8bac60
-		&& Z_LVAL_PP(trace) > 0) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS &&
8bac60
+	    (Z_TYPE_PP(trace) == IS_BOOL || Z_TYPE_PP(trace) == IS_LONG) && Z_LVAL_PP(trace) != 0) {
8bac60
 		zend_hash_del(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request"));
8bac60
 		zend_hash_del(Z_OBJPROP_P(this_ptr), "__last_response", sizeof("__last_response"));
8bac60
 	}
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_soap_version", sizeof("_soap_version"), (void **) &tmp) == SUCCESS
8bac60
-		&& Z_LVAL_PP(tmp) == SOAP_1_2) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_soap_version", sizeof("_soap_version"), (void **) &tmp) == SUCCESS &&
8bac60
+		Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) == SOAP_1_2) {
8bac60
 		soap_version = SOAP_1_2;
8bac60
 	} else {
8bac60
 		soap_version = SOAP_1_1;
8bac60
@@ -2747,7 +2752,7 @@
8bac60
 			zval **uri;
8bac60
 			smart_str action = {0};
8bac60
 
8bac60
-			if (zend_hash_find(Z_OBJPROP_P(this_ptr), "uri", sizeof("uri"), (void *)&uri) == FAILURE) {
8bac60
+			if (zend_hash_find(Z_OBJPROP_P(this_ptr), "uri", sizeof("uri"), (void *)&uri) == FAILURE || Z_TYPE_PP(uri) != IS_STRING) {
8bac60
 				add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL TSRMLS_CC);
8bac60
 			} else if (location == NULL) {
8bac60
 				add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL TSRMLS_CC);
8bac60
@@ -2905,7 +2910,7 @@
8bac60
 	}
8bac60
 
8bac60
 	/* Add default headers */
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &tmp)==SUCCESS) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers"), (void **) &tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_ARRAY) {
8bac60
 		HashTable *default_headers = Z_ARRVAL_P(*tmp);
8bac60
 		if (soap_headers) {
8bac60
 			if (!free_soap_headers) {
8bac60
@@ -3026,7 +3031,8 @@
8bac60
 		return;
8bac60
 	}
8bac60
 
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request"), (void **)&tmp) == SUCCESS) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request"), (void **)&tmp) == SUCCESS &&
8bac60
+	    Z_TYPE_PP(tmp) == IS_STRING) {
8bac60
 		RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
8bac60
 	}
8bac60
 	RETURN_NULL();
8bac60
@@ -3044,7 +3050,8 @@
8bac60
 		return;
8bac60
 	}
8bac60
 	
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response", sizeof("__last_response"), (void **)&tmp) == SUCCESS) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response", sizeof("__last_response"), (void **)&tmp) == SUCCESS &&
8bac60
+	    Z_TYPE_PP(tmp) == IS_STRING) {
8bac60
 		RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
8bac60
 	}
8bac60
 	RETURN_NULL();
8bac60
@@ -3062,7 +3069,8 @@
8bac60
 		return;
8bac60
 	}
8bac60
 	
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request_headers", sizeof("__last_request_headers"), (void **)&tmp) == SUCCESS) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_request_headers", sizeof("__last_request_headers"), (void **)&tmp) == SUCCESS &&
8bac60
+	    Z_TYPE_PP(tmp) == IS_STRING) {
8bac60
 		RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
8bac60
 	}
8bac60
 	RETURN_NULL();
8bac60
@@ -3080,7 +3088,8 @@
8bac60
 		return;
8bac60
 	}
8bac60
 
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response_headers", sizeof("__last_response_headers"), (void **)&tmp) == SUCCESS) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__last_response_headers", sizeof("__last_response_headers"), (void **)&tmp) == SUCCESS &&
8bac60
+	    Z_TYPE_PP(tmp) == IS_STRING) {
8bac60
 		RETURN_STRINGL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
8bac60
 	}
8bac60
 	RETURN_NULL();
8bac60
@@ -3136,13 +3145,15 @@
8bac60
 	}
8bac60
 
8bac60
 	if (val == NULL) {
8bac60
-		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS) {
8bac60
+		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(cookies) == IS_ARRAY) {
8bac60
 			zend_hash_del(Z_ARRVAL_PP(cookies), name, name_len+1);
8bac60
 		}
8bac60
 	} else {
8bac60
 		zval *zcookie;
8bac60
 
8bac60
-		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == FAILURE) {
8bac60
+		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == FAILURE ||
8bac60
+		    Z_TYPE_PP(cookies) != IS_ARRAY) {
8bac60
 			zval *tmp_cookies;
8bac60
 
8bac60
 			MAKE_STD_ZVAL(tmp_cookies);
8bac60
@@ -3170,7 +3181,8 @@
8bac60
 
8bac60
 	array_init(return_value);
8bac60
 
8bac60
-	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) != FAILURE) {
8bac60
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) != FAILURE &&
8bac60
+	    Z_TYPE_PP(cookies) == IS_ARRAY) {
8bac60
 		zend_hash_copy(Z_ARRVAL_P(return_value), Z_ARRVAL_P(*cookies), (copy_ctor_func_t) zval_add_ref, (void *)&tmp, sizeof(zval*));
8bac60
 	}
8bac60
 }
8bac60
@@ -3992,7 +4004,8 @@
8bac60
 		}
8bac60
 
8bac60
 		if (version == SOAP_1_1) {
8bac60
-			if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) {
8bac60
+			if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS &&
8bac60
+			    Z_TYPE_PP(tmp) == IS_STRING) {
8bac60
 				size_t new_len;
8bac60
 				xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode"));
8bac60
 				char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
8bac60
@@ -4017,7 +4030,8 @@
8bac60
 			}
8bac60
 			detail_name = "detail";
8bac60
 		} else {
8bac60
-			if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) {
8bac60
+			if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS &&
8bac60
+			    Z_TYPE_PP(tmp) == IS_STRING) {
8bac60
 				size_t new_len;
8bac60
 				xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL);
8bac60
 				char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
8bac60
@@ -4257,7 +4271,8 @@
8bac60
 			}
8bac60
 		}
8bac60
 	} else {
8bac60
-		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "style", sizeof("style"), (void **)&zstyle) == SUCCESS) {
8bac60
+		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "style", sizeof("style"), (void **)&zstyle) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(zstyle) == IS_LONG) {
8bac60
 			style = Z_LVAL_PP(zstyle);
8bac60
 		} else {
8bac60
 			style = SOAP_RPC;
8bac60
@@ -4280,7 +4295,7 @@
8bac60
 		}
8bac60
 
8bac60
 		if (zend_hash_find(Z_OBJPROP_P(this_ptr), "use", sizeof("use"), (void **)&zuse) == SUCCESS &&
8bac60
-			  Z_LVAL_PP(zuse) == SOAP_LITERAL) {
8bac60
+		    Z_TYPE_PP(zuse) == IS_LONG && Z_LVAL_PP(zuse) == SOAP_LITERAL) {
8bac60
 			use = SOAP_LITERAL;
8bac60
 		} else {
8bac60
 			use = SOAP_ENCODED;
8bac60
@@ -4410,6 +4425,7 @@
8bac60
 		zval **param_data;
8bac60
 
8bac60
 		if (zend_hash_find(Z_OBJPROP_P(param_val), "param_name", sizeof("param_name"), (void **)&param_name) == SUCCESS &&
8bac60
+		    Z_TYPE_PP(param_name) == IS_STRING &&
8bac60
 		    zend_hash_find(Z_OBJPROP_P(param_val), "param_data", sizeof("param_data"), (void **)&param_data) == SUCCESS) {
8bac60
 			param_val = *param_data;
8bac60
 			name = Z_STRVAL_PP(param_name);
8bac60
diff --git a/ext/soap/tests/bugs/bug69085.phpt b/ext/soap/tests/bugs/bug69085.phpt
8bac60
new file mode 100644
8bac60
index 0000000..cb27cfd
8bac60
--- /dev/null
8bac60
+++ b/ext/soap/tests/bugs/bug69085.phpt
8bac60
@@ -0,0 +1,17 @@
8bac60
+--TEST--
8bac60
+Bug #69085 (SoapClient's __call() type confusion through unserialize())
8bac60
+--SKIPIF--
8bac60
+
8bac60
+--INI--
8bac60
+soap.wsdl_cache_enabled=0
8bac60
+--FILE--
8bac60
+
8bac60
+
8bac60
+$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";}');
8bac60
+try {
8bac60
+	$dummy->whatever();
8bac60
+} catch (Exception $e) {
8bac60
+	echo "okey";
8bac60
+}
8bac60
+--EXPECT--
8bac60
+okey