XalanVector::insert bug ----------------------- Key: XALANC-707 URL: https://issues.apache.org/jira/browse/XALANC-707 Project: XalanC Issue Type: Bug Components: XalanC Affects Versions: CurrentCVS Environment: any Reporter: Michael Kupchuk Priority: Critical
We faced a crash in ElemComment::endElement because method iterator XalanVector::insert(iterator thePosition, const value_type& theData) returns invalid iterator. Our testcase has a quite complex xslt-files, but in short description we transform two XML-files with the same xslt-file. And Xalan crashes on second transformation while "fix up any occurrences of the sequence '--' in the comment's data by inserting a space between them". Here is the bug description. Bug place callstack: XalanVector::insert XalanDOMString::insert ElemComment::endElement ElemTemplateElement::execute StylesheetRoot::process XSLTEngineImpl::process XalanTransformer::doTransform XalanTransformer::transform we fall into the "true" branch of "if (m_allocation > m_size)" thus calling "insert(thePosition, 1, theData);" and returning old iterator thePosition. But in XalanVector::insert(iterator thePosition, const value_type& theData) we fall into the "true" branch of "if (theTotalSize > capacity())" which creates new vector and swaps it with "this". Therefore thePosition iterator becomes invalid. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org For additional commands, e-mail: xalan-dev-h...@xml.apache.org