Kaydet (Commit) b7f90b8f authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

protect against past-the-end access of empty string

Change-Id: I4518d1a2795f4775aec7f3eb495e39afe30ec7be
üst a6f3bead
...@@ -2290,13 +2290,13 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, ...@@ -2290,13 +2290,13 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime,
return false; return false;
nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() );
if ( aStr[0] == '-' ) if ( !aStr.isEmpty() && aStr[0] == '-' )
bNegative = true; bNegative = true;
if ( nSepPos >= 0 ) if ( nSepPos >= 0 )
{ {
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nSecond ) ) if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nSecond ) )
return false; return false;
if ( aStr[0] == '-' ) if ( !aStr.isEmpty() && aStr[0] == '-' )
bNegative = true; bNegative = true;
n100Sec = (short)aStr.toString().toInt32(); n100Sec = (short)aStr.toString().toInt32();
} }
...@@ -2320,7 +2320,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, ...@@ -2320,7 +2320,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime,
aStr.remove( 0, nSepPos+1 ); aStr.remove( 0, nSepPos+1 );
nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() );
if ( aStr[0] == '-' ) if ( !aStr.isEmpty() && aStr[0] == '-' )
bNegative = true; bNegative = true;
if ( nSepPos >= 0 ) if ( nSepPos >= 0 )
{ {
...@@ -2329,7 +2329,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, ...@@ -2329,7 +2329,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime,
aStr.remove( 0, nSepPos+1 ); aStr.remove( 0, nSepPos+1 );
nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() );
if ( aStr[0] == '-' ) if ( !aStr.isEmpty() && aStr[0] == '-' )
bNegative = true; bNegative = true;
if ( nSepPos >= 0 ) if ( nSepPos >= 0 )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment