From d28abc6596d56175c38c96fd77181efb337cf3e8 Mon Sep 17 00:00:00 2001 From: Pawel Date: Wed, 18 Jul 2012 14:50:45 +0200 Subject: [PATCH] 0023326: The 'aSibling' pointer was utilized before it was verified against nullptr. ldom_element.cxx Verifying pointer against NULL before accessing it. --- src/LDOM/LDOM_Element.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } }