diff OrthancServer/Search/IFindConstraint.cpp @ 1792:b769623c806c worklists

safety check
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Nov 2015 11:15:43 +0100
parents 91a5d39ec665
children b1291df2f780
line wrap: on
line diff
--- a/OrthancServer/Search/IFindConstraint.cpp	Wed Nov 18 17:26:00 2015 +0100
+++ b/OrthancServer/Search/IFindConstraint.cpp	Thu Nov 19 11:15:43 2015 +0100
@@ -33,12 +33,14 @@
 #include "../PrecompiledHeadersServer.h"
 #include "IFindConstraint.h"
 
-#include "../FromDcmtkBridge.h"
 #include "ListConstraint.h"
 #include "RangeConstraint.h"
 #include "ValueConstraint.h"
 #include "WildcardConstraint.h"
 
+#include "../FromDcmtkBridge.h"
+#include "../../Core/OrthancException.h"
+
 namespace Orthanc
 {
   IFindConstraint* IFindConstraint::ParseDicomConstraint(const DicomTag& tag,
@@ -47,6 +49,11 @@
   {
     ValueRepresentation vr = FromDcmtkBridge::GetValueRepresentation(tag);
 
+    if (vr == ValueRepresentation_Sequence)
+    {
+      throw OrthancException(ErrorCode_ParameterOutOfRange);
+    }
+
     if ((vr == ValueRepresentation_Date ||
          vr == ValueRepresentation_DateTime ||
          vr == ValueRepresentation_Time) &&