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 2002/10/10 15:19:15 UTC

DO NOT REPLY [Bug 13491] New: - avoid deleting through void* in DOMDocumentImpl.cpp

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=13491>.
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=13491

avoid deleting through void* in DOMDocumentImpl.cpp

           Summary: avoid deleting through void* in DOMDocumentImpl.cpp
           Product: Xerces-C++
           Version: Nightly build (please specify the date)
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Utilities
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: dgohman@earthlink.net


dom/impl/DOMDocumentImpl.cpp

The argument to the `delete []' DOMDocumentImpl::deleteHeap should be
casted to `char*' to avoid deleting with a `void*'.

     while (fCurrentBlock != 0)
     {
         void *nextBlock = *(void **)fCurrentBlock;
-        delete [] fCurrentBlock;
+        delete [] static_cast<char*>(fCurrentBlock);
         fCurrentBlock = nextBlock;
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org