summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-24 12:18:10 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-04-09 23:22:07 +0200
commit852a0e8c5bd06d54e7a4fdd6ffce252d43b05bd4 (patch)
tree555ad069aae1e99854b97377b0b6b02c20d3f47d
parentcid#1209863 Untrusted loop bound (diff)
downloadcore-852a0e8c5bd06d54e7a4fdd6ffce252d43b05bd4.tar.gz
core-852a0e8c5bd06d54e7a4fdd6ffce252d43b05bd4.zip
cid#1209863 Untrusted loop bound
Change-Id: Ic8d20e92b4021dfebe01e1265c3afb2bcd509827 Reviewed-on: https://gerrit.libreoffice.org/76259 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 52b92a591943c1988fd3d660bd6fc5ac53ce0f33)
-rw-r--r--vcl/source/font/fontcharmap.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx
index 73600f94f0c2..a375f98fa14f 100644
--- a/vcl/source/font/fontcharmap.cxx
+++ b/vcl/source/font/fontcharmap.cxx
@@ -231,6 +231,11 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
else if( (nFormat == 12) && ((nOffset+16) < nLength) )
{
nRangeCount = GetUInt( pCmap + nOffset + 12 );
+ if (nRangeCount < 0)
+ {
+ SAL_WARN("vcl.gdi", "negative RangeCount");
+ nRangeCount = 0;
+ }
const int nGroupOffset = nOffset + 16;
const int nRemainingLen = nLength - nGroupOffset;