tng 2002/09/27 12:18:40 Modified: c/src/xercesc/dom/impl DOMDocumentImpl.cpp DOMEntityImpl.cpp DOMNotationImpl.cpp Log: DOM L3 fix: check null string first before assigning baseURI Revision Changes Path 1.26 +8 -4 xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp Index: DOMDocumentImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- DOMDocumentImpl.cpp 26 Sep 2002 17:26:04 -0000 1.25 +++ DOMDocumentImpl.cpp 27 Sep 2002 19:18:40 -0000 1.26 @@ -903,9 +903,13 @@ } void DOMDocumentImpl::setDocumentURI(const XMLCh* documentURI){ - XMLCh* temp = (XMLCh*) this->allocate((XMLString::stringLen(documentURI) + 9)*sizeof(XMLCh)); - XMLString::fixURI(documentURI, temp); - fDocumentURI = temp; + if (documentURI && *documentURI) { + XMLCh* temp = (XMLCh*) this->allocate((XMLString::stringLen(documentURI) + 9)*sizeof(XMLCh)); + XMLString::fixURI(documentURI, temp); + fDocumentURI = temp; + } + else + fDocumentURI = 0; } bool DOMDocumentImpl::getStrictErrorChecking() const { 1.14 +8 -4 xml-xerces/c/src/xercesc/dom/impl/DOMEntityImpl.cpp Index: DOMEntityImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMEntityImpl.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- DOMEntityImpl.cpp 26 Sep 2002 17:26:04 -0000 1.13 +++ DOMEntityImpl.cpp 27 Sep 2002 19:18:40 -0000 1.14 @@ -176,9 +176,13 @@ void DOMEntityImpl::setBaseURI(const XMLCh* baseURI) { - XMLCh* temp = (XMLCh*) ((DOMDocumentImpl *)getOwnerDocument())->allocate((XMLString::stringLen(baseURI) + 9)*sizeof(XMLCh)); - XMLString::fixURI(baseURI, temp); - fBaseURI = temp; + if (baseURI && *baseURI) { + XMLCh* temp = (XMLCh*) ((DOMDocumentImpl *)getOwnerDocument())->allocate((XMLString::stringLen(baseURI) + 9)*sizeof(XMLCh)); + XMLString::fixURI(baseURI, temp); + fBaseURI = temp; + } + else + fBaseURI = 0; } 1.11 +8 -4 xml-xerces/c/src/xercesc/dom/impl/DOMNotationImpl.cpp Index: DOMNotationImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNotationImpl.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- DOMNotationImpl.cpp 26 Sep 2002 17:26:04 -0000 1.10 +++ DOMNotationImpl.cpp 27 Sep 2002 19:18:40 -0000 1.11 @@ -161,9 +161,13 @@ } void DOMNotationImpl::setBaseURI(const XMLCh* baseURI) { - XMLCh* temp = (XMLCh*) ((DOMDocumentImpl *)getOwnerDocument())->allocate((XMLString::stringLen(baseURI) + 9)*sizeof(XMLCh)); - XMLString::fixURI(baseURI, temp); - fBaseURI = temp; + if (baseURI && *baseURI) { + XMLCh* temp = (XMLCh*) ((DOMDocumentImpl *)getOwnerDocument())->allocate((XMLString::stringLen(baseURI) + 9)*sizeof(XMLCh)); + XMLString::fixURI(baseURI, temp); + fBaseURI = temp; + } + else + fBaseURI = 0; } const XMLCh* DOMNotationImpl::getBaseURI() const
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]