From 00e7ea76e83153db1f95289a4b101b3031c97b99 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Fri, 4 Feb 2011 20:31:18 +0100 Subject: [PATCH] Fix crash in GraphVizWriter when GRAPHVIZ_TARGET_IGNORE_REGEX is used GraphVizWriter could crash if GRAPHVIZ_TARGET_IGNORE_REGEX was set. Patch from Christian Ehrlicher. Alex --- Source/cmGraphVizWriter.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index bdb33bcdf..de95aa593 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -272,6 +272,12 @@ void cmGraphVizWriter::WriteConnections(const char* targetName, std::map::const_iterator libNameIt = this->TargetNamesNodes.find(libName); + // can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used + if(libNameIt == this->TargetNamesNodes.end()) + { + continue; + } + std::string connectionName = myNodeName; connectionName += "-"; connectionName += libNameIt->second;