summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-22 16:43:01 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-09-23 11:12:06 +0200
commit40136386078ae0aac76806719899eb489cde28db (patch)
treec4bcf7581e4fcb42aa023d65383a9967f99c5af7 /vcl
parent3ac3afcfd5615740fbaf9476792671fea2d940df (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/+/103186 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'vcl')
-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 027df3ce6df1..fcf0c2c64f52 100644
--- a/vcl/source/font/fontcharmap.cxx
+++ b/vcl/source/font/fontcharmap.cxx
@@ -151,7 +151,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 );