summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-06-09 06:31:24 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-06-09 06:33:51 (GMT)
commit82bd909140fc2bd0dc53ff024bb72bd0a3b342e2 (patch)
tree94cebab74ea76e95c3cd1ed51ce115592d67fac7 /tools
parentb42a7c06f0a079fff9c0da90dd4dc71fe50397f9 (diff)
downloadQt-82bd909140fc2bd0dc53ff024bb72bd0a3b342e2.zip
Qt-82bd909140fc2bd0dc53ff024bb72bd0a3b342e2.tar.gz
Qt-82bd909140fc2bd0dc53ff024bb72bd0a3b342e2.tar.bz2
Fixed qdoc3 crash.
Fixes "Invalid read of size 4" reported by valgrind.
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/node.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 4ba3a32..3c7e9dc 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -624,7 +624,7 @@ void InnerNode::removeChild(Node *child)
QMap<QString, Node *>::Iterator prim =
primaryFunctionMap.find(child->name());
NodeList& secs = secondaryFunctionMap[child->name()];
- if (*prim == child) {
+ if (prim != primaryFunctionMap.end() && *prim == child) {
if (secs.isEmpty()) {
primaryFunctionMap.remove(child->name());
}
@@ -636,12 +636,12 @@ void InnerNode::removeChild(Node *child)
secs.removeAll(child);
}
QMap<QString, Node *>::Iterator ent = childMap.find( child->name() );
- if ( *ent == child )
+ if (ent != childMap.end() && *ent == child)
childMap.erase( ent );
}
else {
QMap<QString, Node *>::Iterator ent = childMap.find(child->name());
- if (*ent == child)
+ if (ent != childMap.end() && *ent == child)
childMap.erase(ent);
}
}