summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
authorMatthew J. Francis <mjay.francis@gmail.com>2014-10-17 20:48:08 +0800
committerStephan Bergmann <sbergman@redhat.com>2014-10-20 09:01:03 +0200
commit8091cf383a122f2348d6e25df90fc26579fe6ef7 (patch)
tree438a292e86f64f1a5b0a2295b578016a0b86dc6b /include/rtl
parentc60872984e78511c621ae76ed28ba6338b6d3a68 (diff)
Increase assert coverage of OStringBuffer arguments
Change-Id: Ifd3c9919ef104909efa8964e7a0cb5e723e3331d Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/strbuf.hxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index b8d1d9d8faf0..1bfe640e3587 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;
}