From: srn Date: Thu, 14 Dec 2006 11:39:21 +0000 (+0000) Subject: Added additional checks of inputed GUID string, now if the string is not valid GUID... X-Git-Tag: SALOMEDS_UnitTests_1_2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fd7e920adda8e12a54a5768dca10dbe78ac44ba6;p=modules%2Fkernel.git Added additional checks of inputed GUID string, now if the string is not valid GUID the exception "invalid_argument" is raised --- diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx index 59703419d..8cac2063e 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx @@ -25,6 +25,7 @@ #include "SALOMEDS.hxx" #include +#include #include #include @@ -248,6 +249,8 @@ _PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetFirst() void SALOMEDS_AttributeTreeNode::SetTreeID(const std::string& value) { + if(!Standard_GUID::CheckGUIDFormat((char*)value.c_str())) throw invalid_argument("Invalid GUID"); + if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx b/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx index 1b73e3c5c..c20087a47 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx @@ -25,6 +25,8 @@ #include "SALOMEDS.hxx" #include +#include + #include #include #include @@ -55,6 +57,8 @@ std::string SALOMEDS_AttributeUserID::Value() void SALOMEDS_AttributeUserID::SetValue(const std::string& value) { + if(!Standard_GUID::CheckGUIDFormat((char*)value.c_str())) throw invalid_argument("Invalid GUID"); + if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock;