From: Pawel Date: Wed, 18 Jul 2012 12:50:45 +0000 (+0200) Subject: 0023326: The 'aSibling' pointer was utilized before it was verified against nullptr... X-Git-Tag: V6_5_4_beta1~104 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=d28abc6596d56175c38c96fd77181efb337cf3e8;p=occt-copy.git 0023326: The 'aSibling' pointer was utilized before it was verified against nullptr. ldom_element.cxx Verifying pointer against NULL before accessing it. --- diff --git a/src/LDOM/LDOM_Element.cxx b/src/LDOM/LDOM_Element.cxx index edc90c8e0b..2682de3a9b 100755 --- a/src/LDOM/LDOM_Element.cxx +++ b/src/LDOM/LDOM_Element.cxx @@ -79,12 +79,12 @@ LDOM_Attr LDOM_Element::getAttributeNode (const LDOMString& aName) const if (aNode && aNode -> getNodeType () != LDOM_Node::ATTRIBUTE_NODE) while (1) { const LDOM_BasicNode * aSibling = aNode -> GetSibling(); + if (aSibling == NULL) + return LDOM_Attr (); if (aSibling -> getNodeType () == LDOM_Node::ATTRIBUTE_NODE) { (const LDOM_BasicNode *&) myLastChild = aSibling; break; } - if (aSibling == NULL) - return LDOM_Attr (); aNode = aSibling; } }