]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Added additional checks of inputed GUID string, now if the string is not valid GUID...
authorsrn <srn@opencascade.com>
Thu, 14 Dec 2006 11:39:21 +0000 (11:39 +0000)
committersrn <srn@opencascade.com>
Thu, 14 Dec 2006 11:39:21 +0000 (11:39 +0000)
src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx
src/SALOMEDS/SALOMEDS_AttributeUserID.cxx

index 59703419d340b5e6e7565f6ccaf81dc4812fe743..8cac2063ed264590ed04cf53d35d23993a0ba357 100644 (file)
@@ -25,6 +25,7 @@
 #include "SALOMEDS.hxx"
 
 #include <string>
+#include <stdexcept>
 
 #include <TCollection_AsciiString.hxx>
 #include <TCollection_ExtendedString.hxx>
@@ -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;
index 1b73e3c5c127ea48f96776ff89ff55a572856dec..c20087a4721508c3944267a4385219671cdbaaad 100644 (file)
@@ -25,6 +25,8 @@
 #include "SALOMEDS.hxx"
 
 #include <string>
+#include <stdexcept>
+
 #include <TCollection_AsciiString.hxx> 
 #include <TCollection_ExtendedString.hxx>
 #include <Standard_GUID.hxx>
@@ -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;