summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-03-07 17:49:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-03-07 17:49:41 +0100
commitefc4d6b83fad337e8bee87d87387028d687934de (patch)
tree3ca30e6a11ed2f63bf2a6c126856e5e479c3ca3d /vcl
parent526ac921435266111729161873817b9e9740ca2b (diff)
Do not call OUStringBuffer::copy with bad argument
Change-Id: I7cb6e2343486ff9864c44d061fc38c1203791988
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/field2.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index c6cc613ab9d8..c86ef11bf27d 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -2208,7 +2208,8 @@ static sal_Bool ImplIsValidTimePortion( sal_Bool _bSkipInvalidCharacters, const
static sal_Bool ImplCutTimePortion( OUStringBuffer& _rStr, xub_StrLen _nSepPos, sal_Bool _bSkipInvalidCharacters, short* _pPortion )
{
OUString sPortion(_rStr.getStr(), _nSepPos );
- _rStr = _rStr.copy( _nSepPos + 1 );
+ _rStr = _nSepPos < _rStr.getLength()
+ ? _rStr.copy( _nSepPos + 1 ) : OUStringBuffer();
if ( !ImplIsValidTimePortion( _bSkipInvalidCharacters, sPortion ) )
return sal_False;