diff MySQL/Plugins/MySQLIndex.cpp @ 24:17f849b2af34

sharing plugin initialization code
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Jul 2018 12:17:39 +0200
parents b2ff1cd2907a
children 71eca9b0442a
line wrap: on
line diff
--- a/MySQL/Plugins/MySQLIndex.cpp	Thu Jul 12 10:44:17 2018 +0200
+++ b/MySQL/Plugins/MySQLIndex.cpp	Thu Jul 12 12:17:39 2018 +0200
@@ -56,6 +56,11 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_Plugin);
     }
 
+    if (!MySQLDatabase::IsAlphanumericString(parameters_.GetDatabase()))
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
+    }
+
     if (clearAll_)
     {
       MySQLDatabase::ClearDatabase(parameters_);