diff options
Diffstat (limited to 'connectivity/source/drivers/odbc/OTools.cxx')
-rw-r--r-- | connectivity/source/drivers/odbc/OTools.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx index fb0dc71d716f..4781415de474 100644 --- a/connectivity/source/drivers/odbc/OTools.cxx +++ b/connectivity/source/drivers/odbc/OTools.cxx @@ -20,6 +20,7 @@ #include <odbc/OTools.hxx> #include <odbc/OFunctions.hxx> #include <com/sun/star/sdbc/DataType.hpp> +#include <o3tl/safeint.hxx> #include <osl/diagnose.h> #include <osl/endian.h> #include <odbc/OConnection.hxx> @@ -137,7 +138,7 @@ void OTools::getValue( OConnection const * _pConnection, else { OSL_ENSURE(static_cast<size_t>(_nSize) == properSize, "connectivity::odbc::OTools::getValue got wrongly sized memory region to write result to"); - if ( static_cast<size_t>(_nSize) > properSize ) + if ( o3tl::make_unsigned(_nSize) > properSize ) { SAL_WARN( "connectivity.drivers", "memory region is too big - trying to fudge it"); memset(_pValue, 0, _nSize); @@ -147,7 +148,7 @@ void OTools::getValue( OConnection const * _pConnection, #endif } } - OSL_ENSURE(static_cast<size_t>(_nSize) >= properSize, "memory region is too small"); + OSL_ENSURE(o3tl::make_unsigned(_nSize) >= properSize, "memory region is too small"); SQLLEN pcbValue = SQL_NULL_DATA; OTools::ThrowException(_pConnection, (*reinterpret_cast<T3SQLGetData>(_pConnection->getOdbcFunction(ODBC3SQLFunctionId::GetData)))(_aStatementHandle, |