include/rtl/strbuf.hxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 8091cf383a122f2348d6e25df90fc26579fe6ef7 Author: Matthew J. Francis <mjay.fran...@gmail.com> Date: Fri Oct 17 20:48:08 2014 +0800 Increase assert coverage of OStringBuffer arguments Change-Id: Ifd3c9919ef104909efa8964e7a0cb5e723e3331d Signed-off-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx index b8d1d9d..1bfe640 100644 --- a/include/rtl/strbuf.hxx +++ b/include/rtl/strbuf.hxx @@ -491,7 +491,7 @@ public: */ OStringBuffer & append( const sal_Char * str, sal_Int32 len) { - // insert behind the last character + assert( len >= 0 ); rtl_stringbuffer_insert( &pData, &nCapacity, getLength(), str, len ); return *this; } @@ -729,7 +729,8 @@ public: */ OStringBuffer & insert( sal_Int32 offset, const sal_Char * str, sal_Int32 len) { - // insert behind the last character + assert( offset >= 0 && offset <= pData->length ); + assert( len >= 0 ); rtl_stringbuffer_insert( &pData, &nCapacity, offset, str, len ); return *this; } @@ -911,6 +912,8 @@ public: */ OStringBuffer & remove( sal_Int32 start, sal_Int32 len ) { + assert( start >= 0 && start <= pData->length ); + assert( len >= 0 ); rtl_stringbuffer_remove( &pData, start, len ); return *this; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits