Kaydet (Commit) 5f2a6974 authored tarafından Eike Rathke's avatar Eike Rathke Kaydeden (comit) Caolán McNamara

fix string access out of bounds

Could happen with a malformed subformat string like "[<0-0".

Change-Id: I8eaab2bcb469d91432a41dc349060c273a6575a4
(cherry picked from commit f52aa4d1)
Reviewed-on: https://gerrit.libreoffice.org/16939Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e728c26e
...@@ -697,7 +697,7 @@ SvNumberformat::SvNumberformat(OUString& rString, ...@@ -697,7 +697,7 @@ SvNumberformat::SvNumberformat(OUString& rString,
{ {
fLimit2 = fNumber; fLimit2 = fNumber;
} }
if ( sBuff[nPos] == ']' ) if ( nPos < sBuff.getLength() && sBuff[nPos] == ']' )
{ {
nPos++; nPos++;
} }
......
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