diff Core/DicomNetworking/DicomUserConnection.cpp @ 3741:21efa32c8a10 storage-commitment

safeguard
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 11 Mar 2020 14:28:37 +0100
parents 4fc24b69446a
children c6658187e4b1
line wrap: on
line diff
--- a/Core/DicomNetworking/DicomUserConnection.cpp	Wed Mar 11 11:04:48 2020 +0100
+++ b/Core/DicomNetworking/DicomUserConnection.cpp	Wed Mar 11 14:28:37 2020 +0100
@@ -1685,6 +1685,17 @@
       throw OrthancException(ErrorCode_ParameterOutOfRange);
     }
 
+    for (size_t i = 0; i < sopClassUids.size(); i++)
+    {
+      if (sopClassUids[i].empty() ||
+          sopInstanceUids[i].empty())
+      {
+        throw OrthancException(ErrorCode_ParameterOutOfRange,
+                               "The SOP class/instance UIDs cannot be empty, found: \"" +
+                               sopClassUids[i] + "\" / \"" + sopInstanceUids[i] + "\"");
+      }
+    }
+
     if (transactionUid.size() < 5 ||
         transactionUid.substr(0, 5) != "2.25.")
     {