[ http://issues.apache.org/jira/browse/TUSCANY-529?page=comments#action_12420126 ]
Geoff Winn commented on TUSCANY-529: ------------------------------------ This problem arises because doc->getRootElementName is passing a null pointer to the SDOString constructor, which it cannot handle. This is a more general problem than this one case however the attached patch fixes this particular incident. I will review the code to see if there are other cases that need attention. > Access violation in XMLHelperImpl::save > --------------------------------------- > > Key: TUSCANY-529 > URL: http://issues.apache.org/jira/browse/TUSCANY-529 > Project: Tuscany > Type: Bug > Components: C++ SDO > Versions: Cpp-M1 > Environment: WinXP > Reporter: Caroline Maynard > > Occurs in the case where the root element URI and name are both null. > MSVCRTD! 00379060() > std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::assign(const char * 0x00000000) line 138 + 16 bytes > std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::basic_string<char,std::char_traits<char>,std::allocator<char> >(const char > * 0x00000000, const std::allocator<char> & {...}) line 51 + 39 bytes > commonj::sdo::SDOString::SDOString(const char * 0x00000000) line 53 + 51 bytes > commonj::sdo::SDOXMLWriter::write(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> > {...}, int 0xffffffff) line 124 + 52 bytes > commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> > {...}, int 0xffffffff) line 256 > commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject> > {...}, const char * 0x00000000, const char * 0x00000000, int 0xffffffff) > line 268 + 68 bytes > Here's a patch which worked for me. YMMV: > --- SDOXMLWriter.cpp 2006-07-06 19:45:10.000000000 +0100 > +++ /cygdrive/c/phpbuild/pecl/sdo/commonj/sdo/SDOXMLWriter.cpp > 2006-07-10 11:56:57.664945600 +0100 > @@ -121,15 +121,15 @@ > { > elementURI = root->getType().getURI(); > } > - SDOString elementName = doc->getRootElementName(); > - if (elementName.empty()) > + SDOXMLString elementName = doc->getRootElementName(); > + if (elementName.isNull() || elementName.equals("")) > { > elementName = root->getType().getName(); > elementName = elementName.toLower(0,1); > writeXSIType = true; > } > > - writeDO(root, elementURI, elementName.c_str(), true, true); > + writeDO(root, elementURI, elementName, true, true); > } > rc = xmlTextWriterEndDocument(writer); > if (rc < 0) { -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
