# HG changeset patch # User Alain Mazy # Date 1781685745 -7200 # Node ID 25d0de65d2a8cf467df48fb65d22866301337a3d # Parent 8b3ca3c04521a0bff01d1175ed54d382acfe9405 sync diff -r 8b3ca3c04521 -r 25d0de65d2a8 Resources/Orthanc/CMake/DownloadPackage.cmake --- a/Resources/Orthanc/CMake/DownloadPackage.cmake Wed Jun 03 17:05:59 2026 +0200 +++ b/Resources/Orthanc/CMake/DownloadPackage.cmake Wed Jun 17 10:42:25 2026 +0200 @@ -92,7 +92,7 @@ set(TMP_PATH "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${TMP_FILENAME}") if (NOT EXISTS "${TMP_PATH}") - message("Downloading ${Url}") + message("Downloading ${Url} since the file was not found in ${TMP_PATH}") # This fixes issue 6: "I think cmake shouldn't download the # packages which are not in the system, it should stop and let diff -r 8b3ca3c04521 -r 25d0de65d2a8 Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp --- a/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Wed Jun 03 17:05:59 2026 +0200 +++ b/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Wed Jun 17 10:42:25 2026 +0200 @@ -28,7 +28,7 @@ #include #include #include - +#include #include #include @@ -227,7 +227,7 @@ { Clear(); } - catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) + catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) // NOLINT(bugprone-empty-catch) { // Don't throw exceptions in destructors } @@ -264,7 +264,7 @@ } else { - if (size > 0) + if (buffer != NULL && size > 0) { memcpy(buffer_.data, buffer, size); } @@ -675,7 +675,7 @@ { Clear(); } - catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) + catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) // NOLINT(bugprone-empty-catch) { // Don't throw exceptions in destructors } @@ -977,7 +977,15 @@ return true; case Json::uintValue: - target = configuration_[key].asUInt(); + if (configuration_[key].asUInt() > static_cast(std::numeric_limits::max())) + { + ORTHANC_PLUGINS_LOG_ERROR("The configuration option \"" + GetPath(key) + + "\" is too large to fit in an integer"); + + ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat); + } + + target = static_cast(configuration_[key].asUInt()); return true; default: @@ -1338,7 +1346,7 @@ { Clear(); } - catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) + catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) // NOLINT(bugprone-empty-catch) { // Don't throw exceptions in destructors }