From be3fa7ec41f1d2e7efa6762525b52cc5efd40e2e Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 20 Oct 2005 08:46:57 +0000 Subject: [PATCH] Fix for bug IPAL10345 : S2_M: Attempt to add new node in Supervisor leads to crash of application. --- src/GraphEditor/DataFlowEditor_OutNode.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/GraphEditor/DataFlowEditor_OutNode.cxx b/src/GraphEditor/DataFlowEditor_OutNode.cxx index da51219..43ee44b 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.cxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.cxx @@ -693,7 +693,13 @@ GraphEditor::InNode * GraphEditor::OutNode::AddNode( int num = Graph()->GetServiceNameNumber( NodeService ) ; ostringstream astr ; astr << num << ends ; - const char * n_instance = astr.str().c_str() ; + + // mkr : fix for bug IPAL10345 + string aStr = astr.str(); + char* n_instance = new char[aStr.length() + 1]; + aStr.copy( n_instance, string::npos ); + n_instance[aStr.length()] = 0; + int lname = strlen( NodeService.ServiceName ) + 1 + strlen( n_instance ) + 1 ; aNodeName = new char[lname] ; -- 2.39.2