You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2001/10/08 01:56:11 UTC
DO NOT REPLY [Bug 4015] New: -
IDDOMImplementation::createDocumentType hopelessly broken
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=4015>.
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=4015
IDDOMImplementation::createDocumentType hopelessly broken
Summary: IDDOMImplementation::createDocumentType hopelessly
broken
Product: Xerces-C++
Version: Nightly build
Platform: Macintosh
OS/Version: Linux
Status: NEW
Severity: Normal
Priority: Other
Component: DOM
AssignedTo: xerces-c-dev@xml.apache.org
ReportedBy: jason@openinformatics.com
When porting some code from DOM to IDOM I got a segfault when I called
IDDOMImplementation::createDocumentType().
Here's the offending bit of code:
return new IDDocumentTypeImpl(0, qualifiedName, publicId, systemId);
It passes in a null pointer as the ownerDocument to:
IDDocumentTypeImpl::IDDocumentTypeImpl(IDOM_Document *ownerDoc,
const XMLCh *qualifiedName,
const XMLCh *pubId,
const XMLCh *sysId)
: fNode(ownerDoc),
fParent(ownerDoc)
{
IDDocumentImpl *docImpl = (IDDocumentImpl *)ownerDoc;
publicId = docImpl->cloneString(pubId);
systemId = docImpl->cloneString(sysId);
At which point it calls cloneString() which attempts to allocate
memory and assign it to the (NULL) ownerDocument ==> segfault.
This code is taken (nearly) verbatim from DOM, where it works because
memory management is handled differently.
How is this every supposed to work for IDOM? Before I create a
Document, I have to first create a DocumentType, but in order to have
one of those the memory must be allocated to an existing
Document...
Catch 22 ...
I would offer a patch but this is hopeless.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org