projects
/
occt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e9eb624
)
0023326: The 'aSibling' pointer was utilized before it was verified against nullptr...
author
Pawel
<pawel-kowalski@wp.pl>
Wed, 18 Jul 2012 12:50:45 +0000
(14:50 +0200)
committer
Pawel Kowalski
<pawel-kowalski@wp.pl>
Fri, 27 Jul 2012 11:14:35 +0000
(15:14 +0400)
Verifying pointer against NULL before accessing it.
src/LDOM/LDOM_Element.cxx
patch
|
blob
|
blame
|
history
diff --git
a/src/LDOM/LDOM_Element.cxx
b/src/LDOM/LDOM_Element.cxx
index
edc90c8
..
2682de3
100755
(executable)
--- 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;
}
}