diff options
Diffstat (limited to 'sal/textenc/converter.cxx')
-rw-r--r-- | sal/textenc/converter.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/textenc/converter.cxx b/sal/textenc/converter.cxx index 92eca3fc190a..60e6a3383708 100644 --- a/sal/textenc/converter.cxx +++ b/sal/textenc/converter.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <o3tl/safeint.hxx> #include <rtl/textcvt.h> #include <sal/types.h> @@ -141,7 +142,7 @@ sal::detail::textenc::handleBadInputUnicodeToTextConversion( cReplace = '_'; break; } - if (static_cast<sal_Size>(pDestBufEnd - *pDestBufPtr) > nPrefixLen) + if (o3tl::make_unsigned(pDestBufEnd - *pDestBufPtr) > nPrefixLen) { while (nPrefixLen-- > 0) *(*pDestBufPtr)++ = *pPrefix++; |