Kaydet (Commit) 683d8f58 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#4115 Integer-overflow

Change-Id: Ibeb62c6df8fe1e200b97ea179d747e735a4ebf3a
Reviewed-on: https://gerrit.libreoffice.org/44451Tested-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 c30e8ba6
...@@ -128,12 +128,12 @@ int SvRTFParser::GetNextToken_() ...@@ -128,12 +128,12 @@ int SvRTFParser::GetNextToken_()
// possible numeric parameter // possible numeric parameter
if( RTF_ISDIGIT( nNextCh ) ) if( RTF_ISDIGIT( nNextCh ) )
{ {
nTokenValue = 0; OUStringBuffer aNumber;
do { do {
nTokenValue *= 10; aNumber.append(static_cast<sal_Unicode>(nNextCh));
nTokenValue += nNextCh - '0';
nNextCh = GetNextChar(); nNextCh = GetNextChar();
} while( RTF_ISDIGIT( nNextCh ) ); } while( RTF_ISDIGIT( nNextCh ) );
nTokenValue = aNumber.toString().toInt32();
if( bNegValue ) if( bNegValue )
nTokenValue = -nTokenValue; nTokenValue = -nTokenValue;
bTokenHasValue=true; bTokenHasValue=true;
......
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