diff options
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index f3d224ecdb0f..427950f8f224 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -1314,7 +1314,9 @@ public: */ OUString copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(()) { - assert(beginIndex >= 0 && beginIndex <= getLength() && count >= 0); + assert(beginIndex >= 0 && beginIndex <= getLength() && count >= 0 + && sal::static_int_cast< sal_uInt32 >(count) <= + sal::static_int_cast< sal_uInt32 >(getLength() - beginIndex)); if ( (beginIndex == 0) && (count == getLength()) ) return *this; else |