DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15796>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15796 PatchAvailable - surroundContents seg-faults Summary: PatchAvailable - surroundContents seg-faults Product: Xerces-C++ Version: 2.1.0 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: DOM AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I get a segmentation fault when do the following pseudo-code: createRange() surroundContents(document_element) The fault appears to lie in DOMRangeImpl::checkReadOnly - namely that it assumes endOffset > 0 - which it is not after createRange() - it is 0 by definition. So my patch just adds an if (endOffset > 0). I am not convinced the rest of the routine is correct though - recurseTreeAndCheck only gets called once, not once for each child. I have not attempted to change this though, as it may be correct. In any case, my patch cures the seg fault (I then get a DOMException code 3, which suggests to me that I shouldn't do this sequence of operations - I must re-read on Range, but in any case, if I do program violate pre-conditions, I am entitled to an exception rather than a seg-fault). --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]