SWDEV-479575 - Graph clone root size check

Change-Id: I34dd43ea36ce1e2623198e6ce1179318b9f7e277
This commit is contained in:
Rahul Manocha
2024-09-04 00:37:00 +00:00
committed by Rahul Manocha
vanhempi 224334e1d2
commit dbf00966b9
+3 -1
Näytä tiedosto
@@ -357,7 +357,9 @@ Graph* Graph::clone(std::unordered_map<Node, Node>& clonedNodes) const {
newGraph->graphUserObj_.insert(userObj);
}
// Clone the root nodes to the new graph
memcpy(&newGraph->roots_[0], &roots_[0], sizeof(Node) * roots_.size());
if (roots_.size() > 0) {
memcpy(&newGraph->roots_[0], &roots_[0], sizeof(Node) * roots_.size());
}
return newGraph;
}