changeset 3498:957e06cbe76a

additional check
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 22 Aug 2019 15:02:19 +0200
parents db71bd11affc
children d8f7c3970e25
files Core/DicomFormat/DicomMap.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomFormat/DicomMap.cpp	Wed Aug 21 16:57:02 2019 +0200
+++ b/Core/DicomFormat/DicomMap.cpp	Thu Aug 22 15:02:19 2019 +0200
@@ -985,6 +985,11 @@
   
   void DicomMap::FromDicomAsJson(const Json::Value& dicomAsJson)
   {
+    if (dicomAsJson.type() != Json::objectValue)
+    {
+      throw OrthancException(ErrorCode_BadFileFormat);
+    }
+    
     Clear();
     
     Json::Value::Members tags = dicomAsJson.getMemberNames();