vcl/source/control/field2.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit b7d74f9e95c7977ff2b527267661d7760c945c02 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Jul 28 15:56:25 2013 +0200 protect against past-the-end access of empty string Change-Id: I4518d1a2795f4775aec7f3eb495e39afe30ec7be Reviewed-on: https://gerrit.libreoffice.org/5151 Reviewed-by: LuboÅ¡ LuÅák <l.lu...@suse.cz> Tested-by: LuboÅ¡ LuÅák <l.lu...@suse.cz> diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index da08f7d..af0bf3e 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -2288,13 +2288,13 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, return false; nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); - if ( aStr[0] == '-' ) + if ( !aStr.isEmpty() && aStr[0] == '-' ) bNegative = true; if ( nSepPos >= 0 ) { if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nSecond ) ) return false; - if ( aStr[0] == '-' ) + if ( !aStr.isEmpty() && aStr[0] == '-' ) bNegative = true; n100Sec = (short)aStr.toString().toInt32(); } @@ -2318,7 +2318,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, aStr.remove( 0, nSepPos+1 ); nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); - if ( aStr[0] == '-' ) + if ( !aStr.isEmpty() && aStr[0] == '-' ) bNegative = true; if ( nSepPos >= 0 ) { @@ -2327,7 +2327,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, aStr.remove( 0, nSepPos+1 ); nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); - if ( aStr[0] == '-' ) + if ( !aStr.isEmpty() && aStr[0] == '-' ) bNegative = true; if ( nSepPos >= 0 ) {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits