# HG changeset patch # User Sebastien Jodogne # Date 1649325888 -7200 # Node ID 17c91e0546368f9972f9ff98bc1e50cf1d00c5b4 # Parent cde17b68d73e2cc328d12b99ca57bee9de2872e6 minor improvements diff -r cde17b68d73e -r 17c91e054636 OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- a/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Mon Apr 04 09:52:54 2022 +0200 +++ b/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Thu Apr 07 12:04:48 2022 +0200 @@ -3703,7 +3703,13 @@ try { - *isReadOnly = (that.StoreFile(WebDavConvertPath(pathSize, pathItems), data, size) ? 1 : 0); + if (static_cast(static_cast(size)) != size) + { + ORTHANC_PLUGINS_THROW_EXCEPTION(NotEnoughMemory); + } + + *isReadOnly = (that.StoreFile(WebDavConvertPath(pathSize, pathItems), data, + static_cast(size)) ? 1 : 0); return OrthancPluginErrorCode_Success; } catch (ORTHANC_PLUGINS_EXCEPTION_CLASS& e) diff -r cde17b68d73e -r 17c91e054636 OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py --- a/OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py Mon Apr 04 09:52:54 2022 +0200 +++ b/OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py Thu Apr 07 12:04:48 2022 +0200 @@ -116,7 +116,8 @@ info = r.json() COUNT_DICOM += 1 - if not info['ParentStudy'] in IMPORTED_STUDIES: + if (isinstance(info, dict) and + not info['ParentStudy'] in IMPORTED_STUDIES): IMPORTED_STUDIES.add(info['ParentStudy']) r2 = requests.get('%s/instances/%s/tags?short' % (args.url, info['ID']),