From e0f33c589fa590d28b24a69ffd78c06b7b0232fc Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 19 Jul 2004 12:53:29 +0000 Subject: [PATCH] Fixed bug #29061 (soap extension segfaults). --- NEWS | 1 + ext/soap/soap.c | 12 +++++++-- ext/soap/tests/bugs/bug29061.phpt | 12 +++++++++ ext/soap/tests/bugs/bug29061.wsdl | 41 +++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 ext/soap/tests/bugs/bug29061.phpt create mode 100644 ext/soap/tests/bugs/bug29061.wsdl diff --git a/NEWS b/NEWS index 4df4ccf430..d2c6d65b6c 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2004, PHP 5.1.0 +- Fixed bug #29061 (soap extension segfaults). (Dmitry) - Added zlib stream filter suport. (Sara) - Changed the implementation of TRUE, FALSE, and NULL from constants to keywords. (Marcus) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index e6ccc79a31..1125849dc8 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1993,10 +1993,18 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act ZVAL_STRINGL(params[0], buf, buf_size, 0); INIT_ZVAL(param1); params[1] = ¶m1; - ZVAL_STRING(params[1], location, 0); + if (location == NULL) { + ZVAL_NULL(params[1]); + } else { + ZVAL_STRING(params[1], location, 0); + } INIT_ZVAL(param2); params[2] = ¶m2; - ZVAL_STRING(params[2], action, 0); + if (action == NULL) { + ZVAL_NULL(params[2]); + } else { + ZVAL_STRING(params[2], action, 0); + } INIT_ZVAL(param3); params[3] = ¶m3; ZVAL_LONG(params[3], version); diff --git a/ext/soap/tests/bugs/bug29061.phpt b/ext/soap/tests/bugs/bug29061.phpt new file mode 100644 index 0000000000..0bf8917fa5 --- /dev/null +++ b/ext/soap/tests/bugs/bug29061.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #29061 (soap extension segfaults) +--SKIPIF-- + +--FILE-- +0)); +$client->getQuote("ibm"); +echo "ok\n"; +?> +--EXPECT-- +ok \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug29061.wsdl b/ext/soap/tests/bugs/bug29061.wsdl new file mode 100644 index 0000000000..fb4d9aa3b5 --- /dev/null +++ b/ext/soap/tests/bugs/bug29061.wsdl @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.50.1