# HG changeset patch # User Sebastien Jodogne # Date 1748874870 -7200 # Node ID 2ee32b4433a51f39770a22e7829eaf90d138a627 # Parent 92c5ad1302042c05853be371dc3feef81d7d3bb3 use SQLite::Statement::ColumnBlobAsString() to retrieve blob columns diff -r 92c5ad130204 -r 2ee32b4433a5 OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp --- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Mon Jun 02 16:24:29 2025 +0200 +++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Mon Jun 02 16:34:30 2025 +0200 @@ -2176,8 +2176,14 @@ } else { - value = s.ColumnString(0); - return true; + if (!s.ColumnBlobAsString(0, &value)) + { + throw OrthancException(ErrorCode_NotEnoughMemory); + } + else + { + return true; + } } } @@ -2213,8 +2219,14 @@ while (statement->Step()) { + std::string value; + if (!statement->ColumnBlobAsString(1, &value)) + { + throw OrthancException(ErrorCode_NotEnoughMemory); + } + keys.push_back(statement->ColumnString(0)); - values.push_back(statement->ColumnString(1)); + values.push_back(value); } } @@ -2267,7 +2279,11 @@ else { rowId = s->ColumnInt64(0); - value = s->ColumnString(1); + + if (!s->ColumnBlobAsString(1, &value)) + { + throw OrthancException(ErrorCode_NotEnoughMemory); + } SQLite::Statement s2(db_, SQLITE_FROM_HERE, "DELETE FROM Queues WHERE id = ?");