[Libreoffice-commits] core.git: vcl/source
Stephan Bergmann
sbergman at redhat.com
Thu Mar 7 08:50:05 PST 2013
vcl/source/control/field2.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit efc4d6b83fad337e8bee87d87387028d687934de
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 7 17:49:41 2013 +0100
Do not call OUStringBuffer::copy with bad argument
Change-Id: I7cb6e2343486ff9864c44d061fc38c1203791988
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index c6cc613..c86ef11 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;
More information about the Libreoffice-commits
mailing list