# HG changeset patch # User Alain Mazy # Date 1780410500 -7200 # Node ID b929ccbda9e41644e361eee1d4258322be029293 # Parent 31641dd2247a7e4a8d41758c044f6a33b0ba4374 fix ReceivedCStoreInstanceFilter Lua callback whose return value was not taken into account diff -r 31641dd2247a -r b929ccbda9e4 NEWS --- a/NEWS Tue Jun 02 15:40:29 2026 +0200 +++ b/NEWS Tue Jun 02 16:28:20 2026 +0200 @@ -54,6 +54,7 @@ * Fixed various OOB read/write (TODO: finalize release notes) * Upgraded dependencies for static builds: - dcmtk 3.7.0 hot-fix: https://github.com/DCMTK/dcmtk/commit/847d50e83ae5bbfbc731c99c142ee1410303d222 +* Lua: fix the "ReceivedCStoreInstanceFilter" Lua callback whose return value was not taken into account. Version 1.12.11 (2026-04-14) diff -r 31641dd2247a -r b929ccbda9e4 OrthancServer/Sources/LuaScripting.cpp --- a/OrthancServer/Sources/LuaScripting.cpp Tue Jun 02 15:40:29 2026 +0200 +++ b/OrthancServer/Sources/LuaScripting.cpp Tue Jun 02 16:28:20 2026 +0200 @@ -1057,7 +1057,7 @@ return true; } - bool LuaScripting::FilterIncomingCStoreInstance(uint16_t& /*dimseStatus*/, + bool LuaScripting::FilterIncomingCStoreInstance(uint16_t& dimseStatus, const DicomInstanceToStore& instance, const Json::Value& simplified) { @@ -1087,10 +1087,16 @@ int result; call.ExecuteToInt(result); - return static_cast(result); + if (result > 0xFFFF || result < 0) + { + throw OrthancException(ErrorCode_ParameterOutOfRange, "The returned DIMSE status should be >= 0 and <= 0xFFFF"); + } + + dimseStatus = static_cast(result); + return dimseStatus == 0; // keep if DimseStatus is SUCCESS } - return true; + return true; // keep }