summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-22 16:43:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-22 20:36:54 +0200
commita7c89adaa0f205aead3c0ad43c0113ff81ba1d98 (patch)
treed73ed42c8e0f80f9f0682fbf6178bd45e298161d /vcl/source
parent8ea4feee03542c767e0b26beb888b63bc653878d (diff)
ofz#25855 overflow in nTmpOffset
we already know nLength is >= 24 so just move the calc to the other term Change-Id: Ic52f1686ccf81e6b13d7eb7e74dbd9cb51c8ea01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103183 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/font/fontcharmap.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx
index d672c76c5f42..cf2c839ef8d5 100644
--- a/vcl/source/font/fontcharmap.cxx
+++ b/vcl/source/font/fontcharmap.cxx
@@ -153,7 +153,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
int nTmpOffset = GetUInt( p+4 );
- if (nTmpOffset + 2 > nLength || nTmpOffset < 0)
+ if (nTmpOffset > nLength - 2 || nTmpOffset < 0)
continue;
int nTmpFormat = GetUShort( pCmap + nTmpOffset );