# HG changeset patch # User Sebastien Jodogne # Date 1748872198 -7200 # Node ID 1639adc016f400701658d1cd9ea39f0175512c0a # Parent 4d5fad701a17b81cd38a2875ab76a432eaa9f9c0 queueId and storeId cannot be empty diff -r 4d5fad701a17 -r 1639adc016f4 OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp --- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Mon Jun 02 15:40:52 2025 +0200 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Mon Jun 02 15:49:58 2025 +0200 @@ -3338,6 +3338,11 @@ const void* value, size_t valueSize) { + if (storeId.empty()) + { + throw OrthancException(ErrorCode_ParameterOutOfRange); + } + if (value == NULL && valueSize > 0) { @@ -3377,6 +3382,11 @@ void StatelessDatabaseOperations::DeleteKeyValue(const std::string& storeId, const std::string& key) { + if (storeId.empty()) + { + throw OrthancException(ErrorCode_ParameterOutOfRange); + } + class Operations : public IReadWriteOperations { private: @@ -3405,6 +3415,11 @@ const std::string& storeId, const std::string& key) { + if (storeId.empty()) + { + throw OrthancException(ErrorCode_ParameterOutOfRange); + } + class Operations : public ReadOnlyOperationsT3 { bool found_; @@ -3435,6 +3450,11 @@ const void* value, size_t valueSize) { + if (queueId.empty()) + { + throw OrthancException(ErrorCode_ParameterOutOfRange); + } + if (value == NULL && valueSize > 0) { @@ -3472,6 +3492,11 @@ const std::string& queueId, QueueOrigin origin) { + if (queueId.empty()) + { + throw OrthancException(ErrorCode_ParameterOutOfRange); + } + class Operations : public IReadWriteOperations { private: @@ -3510,6 +3535,11 @@ uint64_t StatelessDatabaseOperations::GetQueueSize(const std::string& queueId) { + if (queueId.empty()) + { + throw OrthancException(ErrorCode_ParameterOutOfRange); + } + class Operations : public ReadOnlyOperationsT2 { public: @@ -3593,6 +3623,10 @@ storeId_(storeId), limit_(100) { + if (storeId.empty()) + { + throw OrthancException(ErrorCode_ParameterOutOfRange); + } } bool StatelessDatabaseOperations::KeysValuesIterator::Next()