From: Dmitry Stogov Date: Thu, 29 Jan 2004 06:37:51 +0000 (+0000) Subject: fix: possible crash was fixed X-Git-Tag: php-5.0.0b4RC1~238 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7cfe9f8e3f0b1595a982ef3f7df06f37da971ce;p=php fix: possible crash was fixed --- diff --git a/ext/soap/TODO b/ext/soap/TODO index 3001043684..c4ac6891b8 100644 --- a/ext/soap/TODO +++ b/ext/soap/TODO @@ -5,16 +5,12 @@ General - make sure soapserver.map(), soap_encode_to_xml() and soap_encode_to_zval() are really need - reimplement SoapObject::__getfunctions() and SoapObject::__gettypes() to return structures instead of strings +- memory leaks (libxml and WSDL/Schema use malloc to cache WSDL) + SOAP ---- -+ SOAP versioning model -+ SOAP message must not contain a Document Type Declaration - SOAP message MUST NOT contain Processing Instructions (XML_PI_NODE) -+ SOAP 1.1 fault codes ("client","server"), SOAP 1.1 fault codes ("Sender","Receiver") -+ SOAP 1.1 Content-Type - "text/xml", SOAP 1.2 - "application/soap+xml" -+ support for SOAP 1.2 (ignore it) -+ SOAP 1.2 uses the element names env:Code and env:Reason, respectively, for what used to be called faultcode and faultstring in SOAP 1.1. - support for SOAP headers - actor attribute - mustUnderstend attribute @@ -24,12 +20,6 @@ SOAP Encoding -------- ? full support for standard simple types ( - + anyType - + anyURI, - + QName, - + NOTATION, - + normalizedString, - + token, ? language, (pattern: "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*") ? NMTOKEN, (pattern: "\c+") (\c: [a-zA-Z0-9.\-_:]) ? NMTOKENS, (list: NMTOKEN, minLength: 1) @@ -40,8 +30,7 @@ Encoding ? IDREFS, (list: IDREF; minLength: 1) ? ENTITY, (base: NCName) ? ENTITIES, (list: ENTITY; minLength: 1) - ? duration, - + unsignedLong) + ? duration) ? full support for standard date/time types ( ? dateTime, ? time, @@ -58,7 +47,6 @@ Encoding SOAP 1.2 doesn't support partially transmitted and sparse arrays - references to external resources ? support for "nillable" and "nil" -+ default values of - default values of ? provide schema 1999/2001 support??? ? make internal refrences for soap encoding (use seralization logic)??? @@ -66,18 +54,11 @@ Encoding WSDL ---- -+ wsdl and schema import -+ support for message/part element attribute -+ support for portType operation input/output name attribute -+ support for without - support for portType operation parameterOrder attribute - support for binding operation input/output name attribute (part of overloading) - support for -+ support for style "rpc"/"document" encoding (client part) - support for style "rpc"/"document" encoding (server part) How to get function name from request? May be SoapAction HTTP header? -+ support for "encoded"/"literal" encoding -+ arrayType and "literal" encoding - function/method overloading/redeclaration (test(int); test(string)) - wsdl caching - wsdl auto generation @@ -94,7 +75,6 @@ Schema - ? support for user defined simple types ? restiction - + base ? enumeration ? length (for string, anyURI, hexBinary, base64Binary and derived) list??? ? minLength (for string, hexBinary, base64Binary and derived) list??? @@ -107,7 +87,6 @@ Schema - maxInclusive (for numeric, date types) - totalDigits (for decimal) - fractionDigits (for decimal) - + list ? union ? support for user defined complex types ? full support for content model encoding/decoding @@ -118,16 +97,11 @@ Error Handling Transport --------- -+ support for https:// -+ support for persistent HTTP connections (keep_alive) -- support for HTTP compression (gzip,x-gzip,defalte) -+ support for HTTP authentication -+ HTTP Cookies support -- support for HTTP proxies -- transport abstraction layer -+ SoapAction HTTP header field ? HTTP status codes ? HTTP chunked Transfer-Encoding +- support for HTTP compression (gzip,x-gzip,defalte) +- support for HTTP proxies +- transport abstraction layer??? UDDI ---- diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c index 0962656a27..2040cb04e8 100644 --- a/ext/soap/php_xml.c +++ b/ext/soap/php_xml.c @@ -52,7 +52,11 @@ int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns) if (name == NULL || strcmp(node->name, name) == 0) { if (ns) { xmlNsPtr nsPtr = attr_find_ns(node); - return (strcmp(nsPtr->href, ns) == 0); + if (nsPtr) { + return (strcmp(nsPtr->href, ns) == 0); + } else { + return FALSE; + } } return TRUE; } @@ -64,7 +68,11 @@ int node_is_equal_ex(xmlNodePtr node, char *name, char *ns) if (name == NULL || strcmp(node->name, name) == 0) { if (ns) { xmlNsPtr nsPtr = node_find_ns(node); - return (strcmp(nsPtr->href, ns) == 0); + if (nsPtr) { + return (strcmp(nsPtr->href, ns) == 0); + } else { + return FALSE; + } } return TRUE; }