[jira] [Commented] (XERCESC-2088) Bad casting from DOMTextImpl to DOMElementImpl

2018-11-08 Thread Scott Cantor (JIRA)


[ 
https://issues.apache.org/jira/browse/XERCESC-2088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16680709#comment-16680709
 ] 

Scott Cantor commented on XERCESC-2088:
---

There's no real connection there, it's just that the site happens to be 
generated from files that are (unfortunately) a part of the distribution. If 
you regenerate the site and commit the changed files to the website it doesn't 
matter if there's a release that matches it.

> Bad casting from DOMTextImpl to DOMElementImpl
> --
>
> Key: XERCESC-2088
> URL: https://issues.apache.org/jira/browse/XERCESC-2088
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: DOM
>Affects Versions: 3.1.1, 3.1.2, 3.1.3, 3.1.4
> Environment: ubuntu 16.04 LTS, Intel(R) Core(TM) i7-6700 CPU @ 
> 3.40GHz, 16GB
>Reporter: Yuseok Jeon
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 3.2.0
>
> Attachments: Actual_result.txt, DOMNodeBase.hpp, casting.patch, 
> relationship_tree.jpeg
>
>
> Hi all, 
> Our recently developed type confusion detection tool reports a type_confusion 
> error in the "xercesc/dom/imple/DOMCasts.hpp" 
> xercesc/dom/imple/DOMCasts.hpp, line 146
> static inline DOMNodeImpl *castToNodeImpl(const DOMNode *p)
> {
> DOMElementImpl *pE = (DOMElementImpl *)p;
> return &(pE->fNode);
> }
> p is pointing to the object allocated as DOMTextImpl, and it is casted into 
> DOMElementImpl. However, since DOMElementImpl is not a subobject of 
> DOMTextImpl, it is violating C++ standard rules 5.2.9/11 (down casting is 
> undefined if the object that the pointer to be casted points to is not a 
> suboject of down casting type) and causes undefined behaviors.
> There are similar type-confusion cases as below links. 
>  - (libstdc++) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60734
>  - (Firefox) https://bugzilla.mozilla.org/show_bug.cgi?id=1074280
> I attached a actual type confusion report and object relationship 
> information. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (XERCESC-2088) Bad casting from DOMTextImpl to DOMElementImpl

2018-11-08 Thread Roger Leigh (JIRA)


[ 
https://issues.apache.org/jira/browse/XERCESC-2088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16680450#comment-16680450
 ] 

Roger Leigh commented on XERCESC-2088:
--

I have removed the no-RTTI comments in r1846201.

[~canto...@osu.edu] What's the process for updating the website.  Does it 
require rolling a new release, or can this change be cherry-picked onto the 
website branch?

> Bad casting from DOMTextImpl to DOMElementImpl
> --
>
> Key: XERCESC-2088
> URL: https://issues.apache.org/jira/browse/XERCESC-2088
> Project: Xerces-C++
>  Issue Type: Bug
>  Components: DOM
>Affects Versions: 3.1.1, 3.1.2, 3.1.3, 3.1.4
> Environment: ubuntu 16.04 LTS, Intel(R) Core(TM) i7-6700 CPU @ 
> 3.40GHz, 16GB
>Reporter: Yuseok Jeon
>Assignee: Scott Cantor
>Priority: Major
> Fix For: 3.2.0
>
> Attachments: Actual_result.txt, DOMNodeBase.hpp, casting.patch, 
> relationship_tree.jpeg
>
>
> Hi all, 
> Our recently developed type confusion detection tool reports a type_confusion 
> error in the "xercesc/dom/imple/DOMCasts.hpp" 
> xercesc/dom/imple/DOMCasts.hpp, line 146
> static inline DOMNodeImpl *castToNodeImpl(const DOMNode *p)
> {
> DOMElementImpl *pE = (DOMElementImpl *)p;
> return &(pE->fNode);
> }
> p is pointing to the object allocated as DOMTextImpl, and it is casted into 
> DOMElementImpl. However, since DOMElementImpl is not a subobject of 
> DOMTextImpl, it is violating C++ standard rules 5.2.9/11 (down casting is 
> undefined if the object that the pointer to be casted points to is not a 
> suboject of down casting type) and causes undefined behaviors.
> There are similar type-confusion cases as below links. 
>  - (libstdc++) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60734
>  - (Firefox) https://bugzilla.mozilla.org/show_bug.cgi?id=1074280
> I attached a actual type confusion report and object relationship 
> information. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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